![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Signa-bot code for project BioRobotics, at University of Twente.
Dependencies: mbed QEI MODSERIAL FastPWM ttmath Math
Diff: Motor_tryout.cpp
- Revision:
- 34:0af87f9cfb7b
- Parent:
- 33:88fbf14d8aaf
diff -r 88fbf14d8aaf -r 0af87f9cfb7b Motor_tryout.cpp --- a/Motor_tryout.cpp Thu Oct 31 15:02:17 2019 +0000 +++ b/Motor_tryout.cpp Thu Oct 31 15:16:16 2019 +0000 @@ -193,10 +193,9 @@ // z0 = -172.0 + 10* sin(time_sin); -float r = 20*(1-1/(1+(time_sin))); - x0 = r*sin(6.28 * time_sin); - y0 = r*cos(6.28 * time_sin); - +//float r = 20*(1-1/(1+(time_sin))); +// x0 = r*sin(6.28 * time_sin); +// y0 = r*cos(6.28 * time_sin); delta_calctheta1 (); delta_calctheta2 (); @@ -271,6 +270,31 @@ motor3_pwm.period_us(6); while(true){ + char cc = pc.getc(); + + if (cc=='d' && x0>=-76 && x0<=75) { + x0=x0+1.0f ; + } + + if (cc=='a' && x0>=-75 && x0<=76) { + x0=x0-1.0f; + } + + if (cc=='w' && y0>=-76 && y0<=75){ + y0=y0+1.0f; + } + + if (cc=='s' && y0>=-75 && y0<=76){ + y0=y0-1.0f; + } + + if (cc=='u' && z0>=-211 && z0<=-130){ + z0=z0+1.0f; + } + + if (cc=='j' && z0>=-210 && z0<=-129){ + z0=z0-1.0f; + } }