#include #include #ifdef U8X8_HAVE_HW_SPI #include #endif #ifdef U8X8_HAVE_HW_I2C #include #endif #define Gu8g2_CS_PIN 48 //U8G2_ST7920_128X64_1_HW_SPI lcd (U8G2_R0, Gu8g2_CS_PIN); U8G2_ST7920_128X64_2_8080 lcd(U8G2_R2, 5, 6, 7, 8, 9, 10, 11, 12, 4, U8X8_PIN_NONE, 3, 2); void setup(void) { lcd.begin(); } uint8_t m = 24; int lcd_welcome_count = 0; int lcd_screen = 0; int wert1 = 137, wert2 = 28495; void loop(void) { if (lcd_welcome_count < 3) { lcd.firstPage(); do { lcd.setFont(u8g2_font_10x20_tr); lcd.drawStr(0,30,"CAN Test"); lcd.drawStr(48,50,"Project"); } while ( lcd.nextPage() ); lcd_welcome_count++; } else if (lcd_screen == 0) { lcd.firstPage(); do { lcd.setFont(u8g2_font_6x10_tr); lcd.drawStr(13,9,"CAN Test Project"); lcd.drawLine(4, 12, 124, 12); char buffer[10]; lcd.drawStr(5,23, "Wert 1: "); lcd.drawStr(48,23, itoa(wert1, buffer, 10)); lcd.drawStr(5,34, "Wert 2: "); lcd.drawStr(48,34, itoa(wert2, buffer, 10)); } while ( lcd.nextPage() ); lcd_welcome_count++; } delay(1000); }