LDR test for Stage 1 Engineering at the University of York

Dependencies:   UoY-serial

Revision:
4:390669f57ccc
Parent:
2:4dca570013d8
--- a/main.cpp	Thu Sep 16 19:57:31 2021 +0000
+++ b/main.cpp	Mon Sep 20 13:44:21 2021 +0000
@@ -2,18 +2,11 @@
 
 int main()
 {
-    AnalogIn x(A0);
-    AnalogIn y(A1);
-    DigitalIn button(D2, PullUp);
+    AnalogIn light(A0);
 
     // Loop forever...
     while (true) {
-        // Always print out the X and Y values
-        printf("x:%d y:%d\n", x.read_u16(), y.read_u16());
-        if (button == false) {
-            // If the button is being pressed, add a suitable message
-             printf("\t(button pressed)\n");
-        }
+        printf("Raw light level: %d\n", light.read_u16());
         thread_sleep_for(500);
     }
 }