Update README.md
This commit is contained in:
parent
c19126fc13
commit
a155928f19
1 changed files with 13 additions and 8 deletions
|
@ -57,12 +57,14 @@ bmp280_init_default_params(¶ms);
|
|||
params.mode = BMP280_MODE_FORCED;
|
||||
bmp280_init(¶ms, scl_pin, sda_pin);
|
||||
|
||||
while (1) {
|
||||
bmp280_force_measurement();
|
||||
|
||||
while (bmp280_is_measuring()) {}; // wait for measurement to complete
|
||||
|
||||
bmp280_read(&temperature, &pressure);
|
||||
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
}
|
||||
```
|
||||
|
||||
### Normal mode
|
||||
|
@ -74,12 +76,15 @@ float pressure, temperature;
|
|||
bmp280_init_default_params(¶ms);
|
||||
bmp280_init(¶ms, scl_pin, sda_pin);
|
||||
|
||||
while (1) {
|
||||
bmp280_read(&temperature, &pressure);
|
||||
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
||||
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
The driver is released under MIT license.
|
||||
|
||||
Copyright (c) 2016 sheinz (https://github.com/sheinz)
|
||||
|
|
Loading…
Reference in a new issue