
Uses the analog input value to control how many LEDs are on
Diff: main.cpp
- Revision:
- 1:1e1de02b30cc
- Parent:
- 0:7576b8ed15e8
--- 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