![](/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:
- 81:4263d0ce34d3
- Parent:
- 80:6f9ddb8bb335
- Child:
- 82:bcd96c98af2d
--- a/main.cpp Mon Jun 22 14:47:21 2015 +0000 +++ b/main.cpp Mon Jun 22 15:18:08 2015 +0000 @@ -175,7 +175,7 @@ } } -void looper_motorx() +/*void looper_motorx() { emg_x = (filtered_pect - filtered_deltoid); @@ -207,13 +207,13 @@ Enablex = 0; } -} +}*/ int main() { // Attach the HIDScope::send method from the scope object to the timer at 500Hz. Hier wordt de sample freq aangegeven. // scopeTimer.attach_us(&scope, &HIDScope::send, 2e3); - + /* MS1 = 1; MS2 = 0; MS3 = 0; @@ -292,7 +292,7 @@ wait(1); Enablex = 0; Enabley = 0; - + */ Ticker emgtimer; //biceps arm_biquad_cascade_df1_init_f32(&lowpass_biceps, 1 , lowpass_const, lowpass_biceps_states); arm_biquad_cascade_df1_init_f32(&highnotch_biceps, 2 , highnotch_const, highnotch_biceps_states); @@ -307,8 +307,8 @@ arm_biquad_cascade_df1_init_f32(&highnotch_deltoid, 2 , highnotch_const, highnotch_deltoid_states); emgtimer.attach(looper_emg, 0.01); - Ticker looptimer1; - looptimer1.attach(looper_motorx, 0.01); //X-Spindle motor, why this freq? + // Ticker looptimer1; + //looptimer1.attach(looper_motorx, 0.01); //X-Spindle motor, why this freq? Ticker looptimer2; looptimer2.attach(looper_motory, 0.01); //Y-Spindle motor @@ -317,7 +317,7 @@ while (1) { - lcd.printf("x %.2f, y %.2f \n", Posx.read(), Posy.read()); + //pc.printf("x %.2f, y %.2f \n", Ps_y, emg_y); //lcd.printf("%.2f %.2f %.2f %.2f \n", speed1, step_freq1, speed2, step_freq2); wait(0.01);