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;
|
params.mode = BMP280_MODE_FORCED;
|
||||||
bmp280_init(¶ms, scl_pin, sda_pin);
|
bmp280_init(¶ms, scl_pin, sda_pin);
|
||||||
|
|
||||||
bmp280_force_measurement();
|
while (1) {
|
||||||
|
bmp280_force_measurement();
|
||||||
|
while (bmp280_is_measuring()) {}; // wait for measurement to complete
|
||||||
|
|
||||||
while (bmp280_is_measuring()) {}; // wait for measurement to complete
|
bmp280_read(&temperature, &pressure);
|
||||||
|
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
||||||
bmp280_read(&temperature, &pressure);
|
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||||
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Normal mode
|
### Normal mode
|
||||||
|
@ -74,12 +76,15 @@ float pressure, temperature;
|
||||||
bmp280_init_default_params(¶ms);
|
bmp280_init_default_params(¶ms);
|
||||||
bmp280_init(¶ms, scl_pin, sda_pin);
|
bmp280_init(¶ms, scl_pin, sda_pin);
|
||||||
|
|
||||||
bmp280_read(&temperature, &pressure);
|
while (1) {
|
||||||
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
bmp280_read(&temperature, &pressure);
|
||||||
|
printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature);
|
||||||
|
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The driver is released under MIT license.
|
The driver is released under MIT license.
|
||||||
|
|
||||||
Copyright (c) 2016 sheinz (https://github.com/sheinz)
|
Copyright (c) 2016 sheinz (https://github.com/sheinz)
|
||||||
|
|
Loading…
Reference in a new issue