Cecilia Schneider / Mbed 2 deprecated schneider_hw_2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ccschneider
Date:
Tue Sep 25 13:15:19 2018 +0000
Parent:
0:7576b8ed15e8
Commit message:
Uses the analog input value to control how many LEDs are lit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Sep 25 02:04:21 2018 +0000
+++ b/main.cpp	Tue Sep 25 13:15:19 2018 +0000
@@ -16,7 +16,7 @@
     while (1) {
         ADCdata = Ain;
         wait (0.5); //Updates every half second
-            if(Ain <= 0.2f) { //if the analog input is less than or equal to 0.2 all LEDs will be off
+            if(Ain <= 0.2) { //if the analog input is less than or equal to 0.2 all LEDs will be off
                 pc.printf("%3.2f",ADCdata); //displays analog input value
                 pc.printf(" All LEDs OFF. Voltage at pin 20: "); //displays which LEDs should be lit
                 pc.printf("%3.2f \n\r", ADCdata*3.3); //displays actual voltage at pin 20