dd
Dependencies: BufferedSerial FastAnalogIn FastPWM mbed SHT75
main.cpp
- Committer:
- sbh9428
- Date:
- 2016-02-19
- Revision:
- 0:9bfc4aea91e2
- Child:
- 1:5c42ec7f1aeb
File content as of revision 0:9bfc4aea91e2:
#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; FastAnalogIn temp_sensor_pin(p20); temp_sensor_t temp_sensor(&temp_sensor_pin); FastPWM PWM_pin(p21); DigitalOut PWM_dir(p22); peltier_t peltier(&PWM_pin, &PWM_dir); control_t control(&temp_sensor, &peltier); BufferedSerial pc(USBTX, USBRX); command_t command(&pc, &control); void peltier_control(); int main() { pc.printf("temperature start \n"); controltick.attach(&peltier_control, 1); while(1) { while(pc.readable()) { command.get_data(); } } } void peltier_control() { command.refreshPWM(); }