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.
Fork of Task411-FZ429 by
Revision 2:6cf019cb87f5, committed 2018-03-10
- Comitter:
- martinjamesallen1991
- Date:
- Sat Mar 10 02:26:20 2018 +0000
- Parent:
- 1:d34891c6377e
- Commit message:
- added led
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r d34891c6377e -r 6cf019cb87f5 main.cpp --- a/main.cpp Thu Jul 13 14:52:05 2017 +0000 +++ b/main.cpp Sat Mar 10 02:26:20 2018 +0000 @@ -1,8 +1,10 @@ #include "mbed.h" + //Global objects -BusOut binaryOutput(D5, D6, D7); //Outputs as an integer - +DigitalOut Redled (D7); +DigitalOut Amberled (D6); +DigitalOut Greenled (D5); DigitalIn SW1(D3); DigitalIn SW2(D4); @@ -15,6 +17,17 @@ while(1) { + if (fVin >= 0.5f) +{ + Redled = 1; + Greenled = 0; +} +else +{ + Redled = 0; + Greenled = 1; +} + //Read ADC fVin = AIN;