Quellcode durchsuchen

Experiment millis function with LCD

DricomDragon vor 5 Jahren
Ursprung
Commit
8ec08a9b83
1 geänderte Dateien mit 11 neuen und 4 gelöschten Zeilen
  1. 11 4
      prog/sources/setup-loop.cpp

+ 11 - 4
prog/sources/setup-loop.cpp

@@ -38,7 +38,9 @@ void setup (USER_MODE) {
 	}
 
 	// Init LCD
-	printString(MODE_ "Welcome Jovian");
+	printString(MODE_ "Wake up in ");
+	printUnsigned(MODE_ millis(MODE));
+	printString(MODE_ "ms");
 }
 
 void loop (USER_MODE) {
@@ -67,16 +69,21 @@ void loop (USER_MODE) {
 			// Prevent persistent digit
 			if (counter >= 20) {
 				counter = 0;
-				gotoLineColumn(MODE_ 2, 12);
-				printChar(MODE_ ' ');
+				clearScreen(MODE);
 			}
 
 			// Show action on LCD
 			gotoLineColumn(MODE_ 1, 13 - i);
 			printChar(MODE_ '1');
 
-			gotoLineColumn(MODE_ 2, 13 - counter / 10);
+			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");
 		}
 	}
 }