Ok

Dependencies:   mbed_rtos_types Mutex mbed_rtos_storage mbed Semaphore

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AnalogThread.cpp Source File

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     }