Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:1e1de02b30cc, committed 2018-09-25
- 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