![](/media/cache/profiles/090a24f78cd36ddf8f89779fc5ab22a8.jpg.50x50_q85.png)
Origin firmware.
Dependencies: PID QEI SB1602E mbed-rtos mbed
Fork of PreHeater by
Diff: main.cpp
- Revision:
- 2:387240c58110
- Parent:
- 1:f974481c37b6
- Child:
- 3:9af1bd67c5f8
--- a/main.cpp Sat Jun 13 04:30:15 2015 +0000 +++ b/main.cpp Sat Jun 13 06:34:11 2015 +0000 @@ -3,6 +3,7 @@ #include "QEI.h" #include "rtos.h" #include "math.h" +#include "SB1602E.h" #define ROTATE_PER_REVOLUTIONS 24 //QEI 1 rotate by count #define THR 560 /PTH pull up register value @@ -30,11 +31,17 @@ DigitalOut led1(dp14),led2(dp28); DigitalIn Run(dp17,PullUp); +float temp_sv_input; +double temp_pv,temp_cal; +char *init_massage = "Welcome!"; + +//init_massage = 'Hello'; //Rotary encode pin, pinmode and sppecification instance QEI wheel(dp11, PullUp, dp13, PullUp,NC, ROTATE_PER_REVOLUTIONS, QEI::X2_ENCODING); +//LCD I2C pin asign +SB1602E lcd(dp5, dp27, init_massage); // SDA, SCL -float temp_sv_input; -double temp_pv,temp_cal; + void TempCal_thread(void const *args) { while (true) { @@ -53,9 +60,8 @@ //Insert LCD code -/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -*/ + lcd.printf(0, "Temp SP %.1f\n", temp_sv_input); + lcd.printf(1, "Temp PV %.1f\n", temp_pv); } } @@ -80,9 +86,8 @@ TIC.setProcessValue(temp_cal); //Set the new output. out = TIC.compute(); + } //Wait for another loop calculation. Thread::wait(RATE); - } - } } \ No newline at end of file