Lewis Daw
/
LEDFlashex3
rename the program
Revision 0:4f0e78d6748e, committed 2015-10-21
- Comitter:
- lewisdaw3
- Date:
- Wed Oct 21 13:38:59 2015 +0000
- Commit message:
- rename
Changed in this revision
diff -r 000000000000 -r 4f0e78d6748e elec350.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/elec350.lib Wed Oct 21 13:38:59 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/lewisdaw3/code/elec350/#74965722a384
diff -r 000000000000 -r 4f0e78d6748e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 21 13:38:59 2015 +0000 @@ -0,0 +1,48 @@ +#include "mbed.h" +#include "button.h" +#include "led.h" + +DigitalOut myled(LED1); + +Button button("user"); +Led redLed("red"); +Led greenLed("green"); +Led orangeLed("orange"); +Led blueLed("blue"); + +int main() +{ +// float timer; + + //int LoopNumber = 0; + const int SequenceLength=3; + float delays[SequenceLength];//array + + //while (LoopNumber<SequenceLength) { + + //delays[LoopNumber] = button.GetPulse();//returned by the getpulse method (read()) stored at array + //LoopNumber++; //for memory location within array + //} + + for( int i = 0; i < SequenceLength; i++) { + delays[i] = button.GetPulse(); + } + + while(1) { + for (int loop=0; loop<SequenceLength; loop++) { + redLed.On(); + greenLed.On(); + orangeLed.On(); + blueLed.On(); + + wait(delays[loop]); + + redLed.Off(); + greenLed.Off(); + orangeLed.Off(); + blueLed.Off(); + wait(0.5f); + + } + } +}
diff -r 000000000000 -r 4f0e78d6748e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 21 13:38:59 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file