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 3:3230439ce904, committed 2021-04-19
- Comitter:
- johnc89
- Date:
- Mon Apr 19 18:19:19 2021 +0000
- Parent:
- 2:7e2fbb1f16d4
- Commit message:
- Lab 4 Final Piece of code John Curran T00214119
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7e2fbb1f16d4 -r 3230439ce904 main.cpp --- a/main.cpp Mon Apr 19 18:16:20 2021 +0000 +++ b/main.cpp Mon Apr 19 18:19:19 2021 +0000 @@ -3,9 +3,9 @@ // John Curran T00214119 // when ADC data is between 0.0 and <= 0.2 all leds off // when ADC data is between 0.2 and <= 0.4 red led is on -// when ADC data is between 0.4 and <= 0.6 all leds off -// when ADC data is between 0.6 and <= 0.8 all leds off -// when ADC data is between 0.8 and <= 1.0 all leds off +// when ADC data is between 0.4 and <= 0.6 green led is on +// when ADC data is between 0.6 and <= 0.8 blue led is on +// when ADC data is between 0.8 and <= 1.0 yellow led is on #include "mbed.h" Serial pc(USBTX,USBRX);// serial communications DigitalOut redled(p23);// built in red led @@ -37,7 +37,7 @@ } if(ADCdata>0.4 && ADCdata <= 0.6) { - pc.printf ( " ADCdata >0.4-<=0.8, Green Led is on\n\r"); + pc.printf ( " ADCdata >0.4-<=0.6, Green Led is on\n\r"); redled = 1; greenled=0; blueled= 1; @@ -45,7 +45,7 @@ } if(ADCdata>0.6 && ADCdata <= 0.8) { - pc.printf ( " ADCdata >0.8-<=0.9, Blue Led is on\n\r"); + pc.printf ( " ADCdata >0.6-<=0.8, Blue Led is on\n\r"); redled = 1; greenled=1; blueled= 0; @@ -53,7 +53,7 @@ } if(ADCdata>0.8 && ADCdata <= 1.0) { - pc.printf ( " ADCdata >0.9-<=1.0, Yellow Led is on\n\r"); + pc.printf ( " ADCdata >0.8-<=1.0, Yellow Led is on\n\r"); redled = 0; greenled=0; blueled= 1;