Charles Tritt / Mbed 2 deprecated AtoDSpeed

Dependencies:   mbed

Fork of aReadConditional by Charles Tritt

Revision:
3:0756601ff19e
Parent:
2:e0faf9e57796
Child:
4:acc6be2bbe21
--- a/main.cpp	Mon Mar 27 14:20:32 2017 +0000
+++ b/main.cpp	Fri Sep 22 19:36:53 2017 +0000
@@ -1,5 +1,5 @@
 /*
-    Project: analogRead
+    Project: aReadConditional (for analog read conditional)
     File: main.cpp
     
     Reads from analog input, streams ASCII text to std serial using printf and
@@ -15,14 +15,14 @@
 const int HIGH = 1; // Optional, but makes code more readable.
 const int LOW = 0; // Optional, but makes code more readable.
  
-AnalogIn analog_value(A0);
+AnalogIn analog_value(A0); // Construct AnalogIn object called analog_value.
  
-DigitalOut led(LED1);
+DigitalOut led(LED1); // Construct DigitalOut object called led.
 
 int main() {
     float value; // Value to be read and sent to serial port.
     
-    printf("\nAnalogIn example\n");
+    printf("\nAnalogIn example\n"); // Identify program.
     
     while(true) {
         value = analog_value.read(); // Read the analog input value (0 to 1)
@@ -34,6 +34,6 @@
           led.write(LOW);
         }
         printf("LED = %d\n", (int) led.read()); // Send LED state via serial. 
-        wait(0.25); // 250 ms
+        wait(0.5); // Half a second (500 mS).
     }
 }