![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
111
Dependencies: BufferedSerial FastPWM mbed
Diff: main.cpp
- Revision:
- 0:f3108add3d98
diff -r 000000000000 -r f3108add3d98 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 12 06:52:10 2016 +0000 @@ -0,0 +1,45 @@ +#include "mbed.h" +#include "humsensort.h" +#include "FastPWM.h" +#include "controlt.h" +#include "commandt.h" +#include "pumpt.h" + +BufferedSerial pc(USBTX, USBRX, 2048); + +AnalogIn humidityPin(p20); + +humSensor_t humSensor(&humidityPin); + +FastPWM wetPin(p21); +FastPWM dryPin(p22); + +pump_t wetPump(&wetPin); +pump_t dryPump(&dryPin); + +Ticker sysTick; + +control_t control(&dryPump, &wetPump, &humSensor, &pc); + +command_t command(&pc, &control); + +void refreshPWM(); + +int main() +{ + sysTick.attach(&refreshPWM, 5); + while(1) + { + + while(pc.readable()) + { + command.get_data(); + + } + } +} + +void refreshPWM() +{ + control.refreshPWM(); +} \ No newline at end of file