Engine control program with 3 engines Needs to make a case for each simultaneous engine setting, because of the WAIT after each number of bits have been sent.
Dependencies: mbed-rtos mbed PinDetect
Fork of FinalMotorControl by
Diff: main.cpp
- Revision:
- 2:25bcc26f7a5b
- Parent:
- 1:a3287196a9b3
- Child:
- 3:15be78948724
diff -r a3287196a9b3 -r 25bcc26f7a5b main.cpp --- a/main.cpp Thu Apr 07 10:51:36 2016 +0000 +++ b/main.cpp Thu Apr 07 11:05:26 2016 +0000 @@ -1,6 +1,7 @@ #include "mbed.h" #include "rtos.h" +Serial pc(USBTX, USBRX); // tx, rx //Analog Pins DigitalOut IN1(D3); @@ -69,14 +70,19 @@ { while(true) { - scanf(" %c", &global_direction); + //scanf(" %c", &global_direction); + //global_direction=getchar(); + if(pc.readable()) + { global_direction=pc.getc(); } + + Thread::wait(10); } } int main() { //Thread 1 has constant feed from usb - //Thread t1(input); + Thread t1(input); while (true) { step4Left();