Jan Kamidra
/
Sparkfun_Weather_Meter
Sparkfun's Weather Meter demo
main.cpp@1:22f48756f273, 21 months ago (annotated)
- Committer:
- JohnnyK
- Date:
- Tue Aug 02 09:15:44 2022 +0000
- Revision:
- 1:22f48756f273
- Parent:
- 0:1cd75b75e9fd
Set STD instead small lib because of printf floats
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JohnnyK | 0:1cd75b75e9fd | 1 | #include "mbed.h" |
JohnnyK | 0:1cd75b75e9fd | 2 | #include "WeatherMeters.h" |
JohnnyK | 0:1cd75b75e9fd | 3 | |
JohnnyK | 0:1cd75b75e9fd | 4 | WeatherMeters station(D3, A0, D2, Weather_auto); // change to your pins |
JohnnyK | 0:1cd75b75e9fd | 5 | |
JohnnyK | 0:1cd75b75e9fd | 6 | int main() { |
JohnnyK | 0:1cd75b75e9fd | 7 | printf("Mbed WeatherMeters example\r\n"); |
JohnnyK | 0:1cd75b75e9fd | 8 | // do something before loop |
JohnnyK | 0:1cd75b75e9fd | 9 | while(1){ |
JohnnyK | 0:1cd75b75e9fd | 10 | printf("Windspeed: %3.2f\r\n",station.get_windspeed()); |
JohnnyK | 0:1cd75b75e9fd | 11 | printf("Windvane: %3.2f °\r\n",station.get_windvane()); |
JohnnyK | 0:1cd75b75e9fd | 12 | printf("Raingaug %3.2f\r\n",station.get_raingauge()); |
JohnnyK | 0:1cd75b75e9fd | 13 | thread_sleep_for(1000); |
JohnnyK | 0:1cd75b75e9fd | 14 | } |
JohnnyK | 0:1cd75b75e9fd | 15 | } |