![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: BufferedSerial FastAnalogIn FastPWM mbed SHT75
main.cpp
- Committer:
- sbh9428
- Date:
- 2016-02-22
- Revision:
- 1:5c42ec7f1aeb
- Parent:
- 0:9bfc4aea91e2
- Child:
- 2:4c51394fb35b
File content as of revision 1:5c42ec7f1aeb:
#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); 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, 10); wait(10); while(1) { while(pc.readable()) { command.get_data(); } } } void peltier_control() { command.refreshPWM(); }