Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@4:cdf9641ba817, 2019-06-25 (annotated)
- Committer:
- pmic
- Date:
- Tue Jun 25 14:04:01 2019 +0000
- Revision:
- 4:cdf9641ba817
- Parent:
- 3:aa6c88a89226
- Child:
- 6:898a83da0661
enhance stuff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pmic | 0:5119eeafd9ce | 1 | #include "mbed.h" |
pmic | 2:ecd5c6118888 | 2 | #include "HP206C.h" |
pmic | 0:5119eeafd9ce | 3 | |
pmic | 0:5119eeafd9ce | 4 | Serial serial(SERIAL_TX, SERIAL_RX); |
pmic | 3:aa6c88a89226 | 5 | HP206C barometer(D14, D15); |
pmic | 0:5119eeafd9ce | 6 | float altitude = 0.0f; |
pmic | 0:5119eeafd9ce | 7 | |
pmic | 0:5119eeafd9ce | 8 | int main() |
pmic | 0:5119eeafd9ce | 9 | { |
pmic | 0:5119eeafd9ce | 10 | serial.baud(115200); |
pmic | 2:ecd5c6118888 | 11 | barometer.reset(); |
pmic | 3:aa6c88a89226 | 12 | while(1) { |
pmic | 4:cdf9641ba817 | 13 | altitude = barometer(); |
pmic | 3:aa6c88a89226 | 14 | serial.printf("altitude %f\r\n", altitude); |
pmic | 4:cdf9641ba817 | 15 | wait_ms(20); // don't hammer the serial console |
pmic | 0:5119eeafd9ce | 16 | } |
pmic | 0:5119eeafd9ce | 17 | } |