From fba365137f577a2d4bfd6165d3d510228edba6b7 Mon Sep 17 00:00:00 2001 From: clali Date: Fri, 5 Feb 2016 02:21:40 +0100 Subject: [PATCH] supports splash screen at start up --- Maiskolben.ino | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Maiskolben.ino b/Maiskolben.ino index 5858f07..3df5bd7 100644 --- a/Maiskolben.ino +++ b/Maiskolben.ino @@ -7,6 +7,14 @@ #define VERSION 100 #define EEPROM_CHECK 42 +// splash screen +#define SPLASH_SHOW 1 +#define SPLASH_TIME 2000 +#define SPLASH_LINE1 'Property of' +#define SPLASH_LINE1 ' Name' +#define SPLASH_LINE1 ' Street' +#define SPLASH_LINE1 ' City' + #define STBY_TEMP 150 //SOFTWARE CAN'T MEASURE MORE THAN 422, IF SET TO >= 422 IT'S LIKELY TO KILL YOUR TIP! //If read 1024 on Analog in, the tip is turned off. @@ -73,6 +81,9 @@ void setup() { TCCR2B = TCCR2B & 0xFF; display.begin(); + if (SPLASH_SHOW != 0) + sayHello(); + display.clearDisplay(); if (EEPROM.read(0) != EEPROM_CHECK) { EEPROM.update(0, EEPROM_CHECK); @@ -96,6 +107,19 @@ void setup() { Timer1.attachInterrupt(timer_isr); } +void sayHello() { + display.clearDisplay(); + display.setTextSize(1); + display.setCursor(0,10); + display.print(SPLASH_LINE1); + display.setCursor(0,20); + display.print(SPLASH_LINE2); + display.setCursor(0,30); + display.print(SPLASH_LINE3); + display.setCursor(0,40); + display.print(SPLASH_LINE4); +} + void updateEEPROM() { EEPROM.update(1, stby); for (uint8_t i = 0; i < 3; i++) {