a
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:0a1b9b4666c7
diff -r 000000000000 -r 0a1b9b4666c7 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 28 07:52:09 2015 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" + +DigitalOut Led1(LED1); +DigitalOut Led2(LED2); +DigitalOut Led3(LED3); +DigitalOut Led4(LED4); + +Serial pc(USBTX, USBRX); // tx, rx +char ch; + + + +int main() { + pc.baud(19200); + pc.printf("LED schalten mittels Raspberry PI!\r\n"); + pc.printf("DI Franz Wolf (WF)\r\n"); + pc.printf("Drücken Sie 1, 2, 3 oder 4 (LED) <n>\r\n"); + while (1) { + ch = pc.getc(); + + /* Led4=1; + wait(1.0); + Led4=0; + wait(1.0); + */ + + switch (ch) { + case '1': //Wave-Drive-Betrieb (Wellenschritt-Modus)rechts + Led1 = !Led1; + break; + + case '2': //Wave-Drive-Betrieb (Wellenschritt-Modus)links + Led2 = !Led2; + break; + + default: pc.printf("nichts ist irgendwas\n"); break; + + } + } +}