Cleanup 3rd party samples; update README.md; add some missing copyright, fix builds for boards without certain pin definitions

This commit is contained in:
Graham Sanderson
2021-10-28 14:56:05 -05:00
committed by GitHub
parent 1300621684
commit fa09f2c88e
16 changed files with 111 additions and 117 deletions

View File

@@ -209,14 +209,14 @@ void bmp280_get_calib_params(struct bmp280_calib_param* params) {
int main() {
stdio_init_all();
// useful information for picotool
bi_decl(bi_2pins_with_func(PICO_DEFAULT_I2C_SDA_PIN, PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C));
bi_decl(bi_program_description("BMP280 I2C example for the Raspberry Pi Pico"));
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN)
#warning i2c / bmp280_i2c example requires a board with I2C pins
puts("Default I2C pins were not defined");
#else
// useful information for picotool
bi_decl(bi_2pins_with_func(PICO_DEFAULT_I2C_SDA_PIN, PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C));
bi_decl(bi_program_description("BMP280 I2C example for the Raspberry Pi Pico"));
printf("Hello, BMP280! Reading temperaure and pressure values from sensor...\n");
// I2C is "open drain", pull ups to keep signal high when no data is being sent