Ok
Dependencies: mbed_rtos_types Mutex mbed_rtos_storage mbed Semaphore
AnalogThread.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 00004 AnalogIn soil_moist(A0); 00005 AnalogIn light_sensor(A2); 00006 extern Serial pc; 00007 extern int analog_timer; 00008 float soil; 00009 float light; 00010 00011 00012 void analogThread() { 00013 while (true){ 00014 soil = soil_moist*100; //Values in % 00015 light = light_sensor*100; // Values in % 00016 pc.printf("_"); 00017 Thread::wait(analog_timer); 00018 } 00019 }
Generated on Tue Jul 12 2022 22:06:19 by
1.7.2