dd
Dependencies: BufferedSerial FastAnalogIn FastPWM mbed SHT75
main.cpp
- Committer:
- sbh9428
- Date:
- 2016-03-02
- Revision:
- 2:4c51394fb35b
- Parent:
- 1:5c42ec7f1aeb
- Child:
- 3:72644690e2e6
File content as of revision 2:4c51394fb35b:
#include "mbed.h" #include "BufferedSerial.h" #include "FastAnalogIn.h" #include "FastPWM.h" #include "commandt.h" #include "controlt.h" #include "peltiert.h" #include "tempsensort.h" Ticker controltick; AnalogIn temp_sensor_pin(p19); temp_sensor_t temp_sensor(&temp_sensor_pin); FastPWM PWM_pin(p23); DigitalOut PWM_dir(p22); peltier_t peltier(&PWM_pin, &PWM_dir); BufferedSerial pc(USBTX, USBRX); control_t control(&temp_sensor, &peltier, &pc); command_t command(&pc, &control); void peltier_control(); int main() { pc.printf("temperature start \n"); controltick.attach(&peltier_control, 5); wait(10); while(1) { while(pc.readable()) { command.get_data(); } } } void peltier_control() { command.refreshPWM(); }