EMG driven robot which shoots elastic bands
Fork of ROBOBIRDS_FINAL by
Diff: main.cpp
- Revision:
- 34:67f211c08e74
- Parent:
- 33:4e3870ab4e17
- Child:
- 35:b71140a46b9c
--- a/main.cpp Tue Oct 27 15:33:48 2015 +0000 +++ b/main.cpp Tue Oct 27 16:24:19 2015 +0000 @@ -18,8 +18,10 @@ DigitalIn Button(PTC6); DigitalIn Button2(PTA4); DigitalIn Button3(D9); -AnalogIn EMG(A0); -AnalogIn EMG2(A1); +//AnalogIn EMG(A0); +//AnalogIn EMG2(A1); +AnalogIn EMG(A2); +AnalogIn EMG2(A3); // Tickers & timers @@ -48,7 +50,7 @@ double T4 = 0; // Motor 1 (Translatie) -double n1 = 3.861464193; // Aantal rondjes dat ons apparaat maximaal mag draaien (omhoog) +const double n1 = 3.861464193; // Aantal rondjes dat ons apparaat maximaal mag draaien (omhoog) int Pulses; double Rotatie = 0; //aantal graden dat de motor is gedraaid double Goal; //initele waarde goal waar de motor naar toe moet, dit wordt gedaan @@ -66,7 +68,7 @@ bool OutRange = false; // Motor 2 (Rotatie) -double n2 = 0.3125; // Aantal rondjes dat dat ons apparaat maximaal mag draaien (rotatie) +const double n2 = 0.3125; // Aantal rondjes dat dat ons apparaat maximaal mag draaien (rotatie) int Pulses2; double Rotatie2 = 0; double Goal2; @@ -181,7 +183,7 @@ y8 = biquad(y7,f7_v1,f7_v2,f7_a1,f7_a2,gainLP7*f7_b0,gainLP7*f7_b1,gainLP7*f7_b2); // EMG 2 - u10 = EMG2.read(); + u10 = 0; //EMG2.read(); // Notch y10 = biquad(u10,f3_v3,f3_v4,f3_a1,f3_a2,f3_b0*gainNotch3,f3_b1*gainNotch3,f3_b2*gainNotch3); y12 = biquad(y10,f4_v3,f4_v4,f4_a1,f4_a2,f4_b0*gainNotch4,f4_b1*gainNotch4,f4_b2*gainNotch4); @@ -288,7 +290,6 @@ pc.printf("T1 = %f\nT2 = %f\nT3 = %f\nT4 = %f\n", T1, T2, T3, T4); wait (3); Excecute = true; - } }