Seeedstudio Arch Examples : Analog - Potentiometer example

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
viswesr
Date:
Mon Oct 07 12:30:57 2013 +0000
Parent:
0:b1a8b240b3a2
Commit message:
Minor changes

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Oct 07 05:36:52 2013 +0000
+++ b/main.cpp	Mon Oct 07 12:30:57 2013 +0000
@@ -5,13 +5,13 @@
 
 int main()
 {
-    float ain;
+    float ain;   /* Variable to store the analog input*/
 
     while(1) {
         ain = pot.read(); /* Read analog value (output will be any value between 0 and 1 */
-        led = 1;          /* Switch ON LED        */  
-        wait(ain);        /* Wait for ain Seconds (maximum delay is 1 seconds)*/ 
-        led = 0;          /* Switch Off LED       */    
-        wait(ain);        /* Wait for ain Seconds (maximum delay is 1 seconds)*/ 
+        led = 1;          /* Switch ON LED        */
+        wait(ain);        /* Wait for 'ain' Seconds (maximum delay is 1 seconds)*/
+        led = 0;          /* Switch Off LED       */
+        wait(ain);        /* Wait for 'ain' Seconds (maximum delay is 1 seconds)*/
     }
 }