This is my first project using the mBed to an extent. The software is a basic traffic light with a blinking LED to show it is running and a warning LED before it changes.
Revision 0:810b0d9d1ff3, committed 2011-04-14
- Comitter:
- monpjc
- Date:
- Thu Apr 14 18:32:36 2011 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 14 18:32:36 2011 +0000 @@ -0,0 +1,51 @@ +#include "mbed.h" + +DigitalOut boardLed(LED1); +DigitalOut getReady(LED2); + +DigitalOut redOne(p5); +DigitalOut greenOne(p6); + +DigitalOut redTwo(p9); +DigitalOut greenTwo(p10); + +//a traffic light + +int main() { + + while(1) { + boardLed = 1; + + redOne = 1; + redTwo = 0; + greenOne = 0; + greenTwo = 1; + getReady = 0; + + wait(5); + boardLed = 0; + wait(5); + boardLed = 1; + wait(5); + boardLed = 0; + getReady = 1; + wait(5); + + boardLed = 1; + + redOne = 0; + redTwo = 1; + greenOne = 1; + greenTwo = 0; + getReady = 0; + + wait(5); + boardLed = 0; + wait(5); + boardLed = 1; + wait(5); + boardLed = 0; + getReady = 1; + wait(5); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 14 18:32:36 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912