Gerhard Haberhofer
/
LED01
Erster Versuch
Revision 0:c7ab26aac972, committed 2013-11-05
- Comitter:
- werkmeister01
- Date:
- Tue Nov 05 07:21:25 2013 +0000
- Commit message:
- Test01
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 c7ab26aac972 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Nov 05 07:21:25 2013 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" + +// mbed Interface Hardware definitions +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +// Host PC Communication channels +Serial pc(USBTX, USBRX); // tx, rx + + +int main() { + int x; + + pc.printf("LED Test\n\r"); + + x=3; + + switch(x) { + case 1: myled1=1; + myled2=0; + myled3=0; + myled4=0; + break; + + case 2: myled1=0; + myled2=1; + myled3=0; + myled4=0; + break; + + case 3: myled1=0; + myled2=0; + myled3=1; + myled4=0; + break; + + case 4: myled1=0; + myled2=0; + myled3=0; + myled4=1; + break; + + default: + pc.printf("Ooooops\n\r"); + break; + } +} + \ No newline at end of file
diff -r 000000000000 -r c7ab26aac972 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Nov 05 07:21:25 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file