ReflowController/Software/reflowController/display.ino

38 lines
1.2 KiB
C++

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
//U8G2_ST7920_128X64_1_HW_SPI(rotation, cs [, reset]) [page buffer, size = 128 bytes]
//U8G2_ST7920_128X64_2_HW_SPI(rotation, cs [, reset]) [page buffer, size = 256 bytes]
//U8G2_ST7920_128X64_F_HW_SPI(rotation, cs [, reset]) [full framebuffer, size = 1024 bytes]
U8G2_ST7920_128X64_2_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8);
void Display_Init(void) {
u8g2.begin();
}
void Display_Task(void) {
char text[10] = {0};
u8g2.firstPage();
do {
u8g2.drawLine(0,15,128,15); // horizontale oben
u8g2.drawLine(64,16,64,48); // senkrechte mitte
u8g2.drawLine(0,49,128,49); // horizontale unten
u8g2.setFont(u8g2_font_ncenB10_tf);
u8g2.drawStr(1,12,process.title);
u8g2.setFont(u8g2_font_ncenB14_tf);
sprintf(text,"%3d C",round(process.temp));
u8g2.drawStr(0,31,text);
sprintf(text,"%3d C",round(oven_temp));
u8g2.drawStr(0,47,text);
sprintf(text,"%02d:%02d",process.timer / 60, process.timer % 60);
u8g2.drawStr(66,31,text);
sprintf(text,"%02d:%02d",process.countdown / 60, process.countdown % 60);
u8g2.drawStr(66,47,text);
} while ( u8g2.nextPage() );
}