![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
4 directional EMG control of the XY table. Made during my bachelor end assignment.
Dependencies: C12832_lcd HIDScope mbed-dsp mbed
Diff: main.cpp
- Revision:
- 8:cf4cd539a71d
- Parent:
- 7:b6d7dce49505
--- a/main.cpp Fri Apr 24 09:29:40 2015 +0000 +++ b/main.cpp Fri Apr 24 13:32:37 2015 +0000 @@ -1,4 +1,5 @@ #include "mbed.h" +#include "C12832_lcd.h" DigitalOut Dir(p21); PwmOut Step(p22); @@ -6,6 +7,13 @@ DigitalOut MS2(p28); DigitalOut MS3(p29); +C12832_LCD lcd; + +BusIn Up(p15); +BusIn Down(p12); +BusIn Left(p13); +BusIn Right(p16); +BusOut Reset(p14); int main() @@ -17,8 +25,15 @@ Step.period(1.0/1000); // 1 kHz, vanaf 2,5 kHz doet de motor het niet meer. Step.write(0.5); // Duty cycle van 50% - while (1) { - Dir = 1; // Dir 1 is naar boven, Dir 0 naar onder. - } - + while(1) + { + lcd.locate(0,15); // Set Location print a text + // Operations by Joystick + if (Up) + lcd.printf("UP"); + Dir = 1; + if (Down) + lcd.printf("Down"); + Dir = 0; + } } \ No newline at end of file