![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Erster Versuch
Diff: main.cpp
- Revision:
- 0:c7ab26aac972
--- /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