supports splash screen at start up

This commit is contained in:
clali 2016-02-05 02:21:40 +01:00
parent 3e19d9fe86
commit fba365137f

View file

@ -7,6 +7,14 @@
#define VERSION 100 #define VERSION 100
#define EEPROM_CHECK 42 #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 #define STBY_TEMP 150
//SOFTWARE CAN'T MEASURE MORE THAN 422, IF SET TO >= 422 IT'S LIKELY TO KILL YOUR TIP! //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. //If read 1024 on Analog in, the tip is turned off.
@ -73,6 +81,9 @@ void setup() {
TCCR2B = TCCR2B & 0xFF; TCCR2B = TCCR2B & 0xFF;
display.begin(); display.begin();
if (SPLASH_SHOW != 0)
sayHello();
display.clearDisplay(); display.clearDisplay();
if (EEPROM.read(0) != EEPROM_CHECK) { if (EEPROM.read(0) != EEPROM_CHECK) {
EEPROM.update(0, EEPROM_CHECK); EEPROM.update(0, EEPROM_CHECK);
@ -96,6 +107,19 @@ void setup() {
Timer1.attachInterrupt(timer_isr); 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() { void updateEEPROM() {
EEPROM.update(1, stby); EEPROM.update(1, stby);
for (uint8_t i = 0; i < 3; i++) { for (uint8_t i = 0; i < 3; i++) {