Richard McWilliam
/
Lights
This is a simple program that flashes lights on the MBED LPC1768
Revision 0:e032b329184f, committed 2015-06-29
- Comitter:
- rmcwilliam101
- Date:
- Mon Jun 29 12:23:22 2015 +0000
- Commit message:
- Lights rev 1.0
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 e032b329184f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 29 12:23:22 2015 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +/* This program flashes lights on the MBED */ + +/* Define some useful constants */ +#define ON 1 +#define OFF 0 + +/* Create names for lights */ +DigitalOut light1(LED1); /* Control LED1 using light1 */ +DigitalOut light2(LED2); /* Control LED2 using light2 */ + +// Main loop +int main() +{ + /* Define a while loop that runs forever (or until the MBED is reset) */ + while(1) + { + light1=ON; /* Switch light 1 on */ + light2=OFF; /* Switch light2 off */ + wait(0.1); /* Pause for 0.1 seconds (= 100 milliseconds) */ + light1=OFF; + light2=ON; + wait(0.1); + } +}
diff -r 000000000000 -r e032b329184f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 29 12:23:22 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file