@@ -76,8 +76,19 @@ int main(void)
ssd1306_test();
uint8_t toggle = 0;
int16_t temp = 0;
while(1)
{
temp = SPI_I2S_ReceiveData(SPI2);
ssd1306_DrawString("Temp: ", 1, 40);
char tempstr[5];
char test = temp + 0x30;
//sprintf(tempstr, "%d", test);
//ssd1306_DrawString(tempstr, 1, 70);
//ssd1306_block_write();
// Process sensor inputs [TODO: 5hz?]
@@ -178,9 +189,10 @@ void machine()
// Write text to OLED
// [ therm :: idle ]
ssd1306_DrawString("therm :: idle ", 0, 40);
// Button handler
if(GPIO_ReadInputDataBit(SW_BTN)) {
if(!GPIO_ReadInputDataBit(SW_BTN)) {
state = STATE_SETP;
}
@@ -194,10 +206,11 @@ void machine()
// [ therm :: set p ]
// [ p = 12 ]
ssd1306_DrawString("therm :: set p", 0, 40);
state = STATE_IDLE;
state = STATE_SETI;
// Event Handler
@@ -210,10 +223,11 @@ void machine()
// [ therm :: set i ]
// [ i = 12 ]
ssd1306_DrawString("therm :: set i", 0, 40);
state = STATE_SETD;
@@ -226,9 +240,10 @@ void machine()
// [ therm :: set d ]
// [ d = 12 ]
ssd1306_DrawString("therm :: set d", 0, 40);
@@ -242,9 +257,10 @@ void machine()
// [ therm : preheating brew ]
// [ 30 => 120 C ]
ssd1306_DrawString("therm :: Bpreheat", 0, 40);
@@ -260,10 +276,11 @@ void machine()
// [ therm : ready to brew ]
ssd1306_DrawString("therm :: Bready", 0, 40);
@@ -277,9 +294,10 @@ void machine()
// [ therm : preheating steam ]
ssd1306_DrawString("therm :: Spreheat", 0, 40);
@@ -295,9 +313,10 @@ void machine()
// [ therm : ready to steam ]
ssd1306_DrawString("therm :: Sready", 0, 40);
@@ -310,6 +329,7 @@ void machine()
// Something is terribly wrong
default:
ssd1306_DrawString("therm :: BAD BAD", 0, 40);
} break;
Status change: