writeDisplay als eigene Funktion ausgelagert
This commit is contained in:
parent
ae78a24959
commit
d07f251b04
|
@ -116,17 +116,11 @@ pinMode(MISO, INPUT);
|
|||
|
||||
void loop() {
|
||||
unsigned long currentMillis = millis();
|
||||
|
||||
UP = digitalRead(SCK);
|
||||
DOWN = digitalRead(MOSI);
|
||||
ENTER = digitalRead(MISO);
|
||||
display.setTextSize(2);
|
||||
display.setTextColor(SSD1306_WHITE); // Draw white text
|
||||
display.setCursor(0,0); // Start at top-left corner
|
||||
if (MotorDelay != MotorDelayOld){
|
||||
display.clearDisplay();
|
||||
display.println(F("Delay: ")); display.println(MotorDelay); display.println(MotorDelayEEPROM);
|
||||
display.display();
|
||||
writeDisplay();
|
||||
MotorDelayOld = MotorDelay;
|
||||
}
|
||||
if(UP == 1 && UP != UP_OLD){
|
||||
|
@ -141,9 +135,7 @@ void loop() {
|
|||
previousMillis = currentMillis;
|
||||
EEPROM.write(0, MotorDelay);
|
||||
MotorDelayEEPROM = EEPROM.read(0);
|
||||
display.clearDisplay();
|
||||
display.println(F("Delay: ")); display.println(MotorDelay); display.println(MotorDelayEEPROM);
|
||||
display.display();
|
||||
writeDisplay();
|
||||
MotorDelayOld = MotorDelay;
|
||||
}
|
||||
}
|
||||
|
@ -164,3 +156,12 @@ void testdrawbitmap(void) {
|
|||
logo_bmp, LOGO_WIDTH, LOGO_HEIGHT, 1);
|
||||
display.display();
|
||||
}
|
||||
|
||||
void writeDisplay(void) {
|
||||
display.setTextSize(2);
|
||||
display.setTextColor(SSD1306_WHITE); // Draw white text
|
||||
display.setCursor(0,0); // Start at top-left corner
|
||||
display.clearDisplay();
|
||||
display.println(F("Delay: ")); display.println(MotorDelay); display.println(F("EEPROM: ")); display.println(MotorDelayEEPROM);
|
||||
display.display();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue