Browse Source

Show date in real time on LCD

DricomDragon 5 years ago
parent
commit
8bcbf7b980
1 changed files with 5 additions and 43 deletions
  1. 5 43
      prog/sources/setup-loop.cpp

+ 5 - 43
prog/sources/setup-loop.cpp

@@ -41,50 +41,12 @@ void setup (USER_MODE) {
 	printString(MODE_ "Wake up in ");
 	printUnsigned(MODE_ millis(MODE));
 	printString(MODE_ "ms");
+
+	gotoLineColumn(MODE_ 1, 0);
 }
 
 void loop (USER_MODE) {
-
-	// Shift bits
-	for (unsigned int i(0); i < 5; i++) {
-		antiBlinkBuffer[i] <<= 1;
-
-		if (digitalRead(BUTTON[i]))
-			antiBlinkBuffer[i] |= 0x01;
-
-		// Command leds with buttons
-		if (antiBlinkBuffer[i] == bufferEmpty) {
-			buttonReleased[i] = false;
-		}
-		else if (antiBlinkBuffer[i] == bufferFull) {
-			buttonReleased[i] = true;
-			actionDone[i] = false;
-		}
-
-		if (!buttonReleased[i] && !actionDone[i]) {
-			digitalToggle(LED[i]);
-			actionDone[i] = true;
-			counter ++;
-			
-			// Prevent persistent digit
-			if (counter >= 20) {
-				counter = 0;
-				clearScreen(MODE);
-			}
-
-			// Show action on LCD
-			gotoLineColumn(MODE_ 1, 13 - i);
-			printChar(MODE_ '1');
-
-			gotoLineColumn(MODE_ 2, 5 - counter / 10);
-			printString(MODE_ "Counter:");
-			printUnsigned(MODE_ counter);
-
-			gotoLineColumn(MODE_ 3, 0);
-			printString(MODE_ "Date:");
-			printUnsigned(MODE_ millis(MODE));
-			printString(MODE_ "ms");
-		}
-	}
+	gotoLineColumn(MODE_ 1, 0);
+	printString(MODE_ "Date:");
+	printUnsigned(MODE_ millis(MODE));
 }
-