![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
demo program for th02 disco l072
Dependencies: mbed driver_mbed_TH02
Revision 0:af8ebf004802, committed 2021-01-25
- Comitter:
- superphil06
- Date:
- Mon Jan 25 16:37:24 2021 +0000
- Commit message:
- demo program for th02
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/driver_mbed_TH02.lib Mon Jan 25 16:37:24 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/TaylorGy/code/driver_mbed_TH02/#89151affda00
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jan 25 16:37:24 2021 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +#include "driver_mbed_TH02.h" +/* +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +InterruptIn mybutton(USER_BUTTON); +*/ +double tempo = 0.3; // LED blinking delay + +// Change LEDs blinking frequency +void change_blinking_frequency() { + if (tempo == 0.3) // If leds have low frequency + tempo = 0.1; // Set the fast frequency + else // If leds have fast frequency + tempo = 0.3; // Set the low frequency +} + +int main() { + float fTemp,fHumid; + + + + while(1) { + fTemp=myTH02.ReadTemperature(); + printf("\r\n temp=%f",fTemp); + fHumid=myTH02.ReadHumidity(); + printf("\r\n humid=%f",fHumid); + wait(tempo); // wait tempo + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jan 25 16:37:24 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file