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:
- 4:4d655fdae399
- Parent:
- 3:15be78948724
- Child:
- 5:fdc7a779d525
diff -r 15be78948724 -r 4d655fdae399 main.cpp --- a/main.cpp Fri Apr 08 13:27:08 2016 +0000 +++ b/main.cpp Wed Apr 13 10:10:23 2016 +0000 @@ -87,28 +87,43 @@ while (true) { + //Thread::wait(5); - + //0 STEPS LEFT AT MAX SPEED if (m_cmd == '0') { + fart = 1000; global_direction = '0'; step4Left(); + //printf("LEFT \n"); //printf("%c \n" + global_direction); } + //1 STEPS RIGHT AT MAX SPEED else if (m_cmd == '1') { + fart = 1000; global_direction = '1'; step4Right(); //printf("RIGHT \n"); + } + else + { + global_direction = 'x'; + } if (m_cmd == 'a') { - fart = 1000; + fart = 2000; + global_direction = '1'; + step4Right(); } - else if (m_cmd == 'b') + + else if (m_cmd == 'c') { - fart = 5000; + fart = 2000; + global_direction = '0'; + step4Left(); } if (global_direction =='0') { @@ -118,10 +133,7 @@ { step4Right(); } - else - { - global_direction = 'x'; - } + } } //END Main