Browse Source

display analogRead(A0)

Fabian Peter Hammerle 1 week ago
parent
commit
87c04e4c7f
1 changed files with 11 additions and 6 deletions
  1. 11 6
      arduino-sketch.ino

+ 11 - 6
arduino-sketch.ino

@@ -19,14 +19,19 @@ void setup() {
         while (true)
             ;
     }
+    display.clearDisplay();
+    display.setTextColor(SSD1306_WHITE);
+    display.println(PROJECT_REPO_URL);
+    display.println(PROJECT_VERSION);
     display.display();
+    delay(2000);
+    display.setTextSize(5);
 }
 
 void loop() {
-    Serial.println("invertDisplay(true)");
-    delay(1000); // ms
-    display.invertDisplay(true);
-    Serial.println("invertDisplay(false)");
-    delay(1000); // ms
-    display.invertDisplay(false);
+    display.clearDisplay();
+    display.setCursor(0, 0);
+    display.print(analogRead(A0));
+    display.display();
+    delay(100); // ms
 }