Dependencies:   mbed_rtos_types Mutex mbed_rtos_storage mbed Semaphore

AnalogThread.cpp

Committer:
daniwestside
Date:
2019-11-27
Branch:
Sinthreads
Revision:
1:c9ef27da97b5
Parent:
0:85df64b421a8

File content as of revision 1:c9ef27da97b5:

#include "mbed.h"
#include "rtos.h"

AnalogIn soil_moist(A0);
AnalogIn light_sensor(A2);
extern Serial pc;
extern int analog_timer;
float soil;
float light;


    void analogThread() {
      while (true){
      soil = soil_moist*100; //Values in %
    light = light_sensor*100; // Values in %
    pc.printf("_");
    Thread::wait(analog_timer); 
      }
    }