Paul Smith
/
Scrolling_Car_Indicator
Directional Indicator for a motor vehicle.
Revision 0:f737398ea333, committed 2014-02-07
- Comitter:
- xnor
- Date:
- Fri Feb 07 20:45:46 2014 +0000
- Commit message:
- First Issue
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r f737398ea333 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Feb 07 20:45:46 2014 +0000 @@ -0,0 +1,29 @@ +/************************************************************************************ +Scrolling Car Indicator +************************************************************************************* +xnor 2014/02/07 +************************************************************************************/ +#include "mbed.h" + +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +int main() +{ + DigitalOut leds[4] = {myled1, myled2, myled3, myled4}; + int pattern[6][4] = {{1,1,1,1},{1,1,1,1},{0,1,1,1},{0,0,1,1},{0,0,0,1},{0,0,0,0}}; + int i=0; + while(1) + { + leds[0] = pattern[i][0]; + leds[1] = pattern[i][1]; + leds[2] = pattern[i][2]; + leds[3] = pattern[i][3]; + wait(0.125); + i++; + i == 6? i=0:0; + } +} +
diff -r 000000000000 -r f737398ea333 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Feb 07 20:45:46 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file