Changeset - 7c9cefbe2702
[Not reviewed]
default
0 1 0
Ethan Zonca - 10 years ago 2014-08-23 23:41:03
ez@ethanzonca.com
PID setting now more user friendly
1 file changed with 19 insertions and 2 deletions:
main.c
19
2
0 comments (0 inline, 0 general)
main.c
Show inline comments
 
@@ -247,6 +247,20 @@ enum state {
 
};
 
 
 
void draw_setpoint() {
 
    char tempstr[3];
 
    itoa_fp(temp, temp_frac, tempstr);
 
    ssd1306_DrawString("    ", 3, 40);
 
    ssd1306_DrawString(tempstr, 3, 40);
 
    ssd1306_DrawString("-> ", 3, 40);
 
    itoa(setpoint, tempstr);
 
    ssd1306_DrawString("    ", 3, 70);
 
    ssd1306_DrawString(tempstr, 3, 70);
 
}
 
 
 
 
 
 
uint8_t state = STATE_IDLE;
 
uint8_t goto_mode = 2;
 
 
@@ -264,7 +278,7 @@ void machine()
 
            // [ therm :: idle ]
 
            ssd1306_DrawString("therm :: idle ", 0, 40);
 
 
            char tempstr[5];
 
            char tempstr[6];
 
            itoa_fp(temp, temp_frac, tempstr);
 
            ssd1306_DrawString("Temp: ", 3, 40);
 
            ssd1306_DrawString("    ", 3, 70);
 
@@ -418,6 +432,7 @@ void machine()
 
            // [ therm : preheating brew ]
 
            // [ 30 => 120 C             ]
 
            ssd1306_DrawString("Preheating...", 0, 40);
 
            draw_setpoint();
 
 
            // Button handler
 
            if(!GPIO_ReadInputDataBit(SW_BTN)) {
 
@@ -437,7 +452,7 @@ void machine()
 
            // [ therm : ready to brew ]
 
            // [ 30 => 120 C           ]
 
            ssd1306_DrawString("Ready to Brew!", 0, 40);
 
 
            draw_setpoint();
 
 
            // Button handler
 
            if(!GPIO_ReadInputDataBit(SW_BTN)) {
 
@@ -455,6 +470,7 @@ void machine()
 
            // [ therm : preheating steam ]
 
            // [ 30 => 120 C           ]
 
            ssd1306_DrawString("Preheating...", 0, 40);
 
            draw_setpoint();
 
 
            // Button handler
 
            if(!GPIO_ReadInputDataBit(SW_BTN)) {
 
@@ -474,6 +490,7 @@ void machine()
 
            // [ therm : ready to steam ]
 
            // [ 30 => 120 C            ]
 
            ssd1306_DrawString("Ready to Steam!", 0, 40);
 
            draw_setpoint();
 
 
            // Button handler
 
            if(!GPIO_ReadInputDataBit(SW_BTN)) {
0 comments (0 inline, 0 general)