robot
Dependencies: Encoder HIDScope MODSERIAL TouchButton mbed-dsp mbed
Fork of Robot2false by
Diff: main.cpp
- Revision:
- 53:bdcbf365a9aa
- Parent:
- 52:b4af2a4ce38e
- Child:
- 54:2b54283b3b47
--- a/main.cpp Sun Nov 02 14:46:03 2014 +0000 +++ b/main.cpp Sun Nov 02 14:48:45 2014 +0000 @@ -83,7 +83,7 @@ float pwm; float new_pwmpos; float new_pwm; -float PWM2 = 0.3; //PWM voor instellen hoek batje +float PWM2 = 0.3; //PWM voor instellen hoek batje, kan waarschijnlijk een stuk langzamer int toestand = WACHTEN; //terugkeren? float setspeed = 0, V3=60, V2=40, V1 =30, Vreturn= 35;//V in counts/s @@ -659,16 +659,16 @@ { case 0: if (motor2.getPosition()>= 0) { - motordir2 = 1; - pwm_motor2.write(PWM2); + motordir2 = 1; + pwm_motor2.write(PWM2); } else { pwm_motor2.write(0); } break; case 1: if (motor2.getPosition()>= 2) { - motordir2 = 1; - pwm_motor2.write(PWM2); + motordir2 = 1; + pwm_motor2.write(PWM2); } if (motor2.getPosition()<= 2) { motordir2 = 0; @@ -679,8 +679,8 @@ break; case 2: if (motor2.getPosition()<= 4) { - motordir2 = 0; - pwm_motor2.write(PWM2); + motordir2 = 0; + pwm_motor2.write(PWM2); } else { pwm_motor2.write(0); } @@ -738,8 +738,8 @@ new_pwmpos = pidpositie(ANGLEMAX, motor1.getPosition()); pwm_motor1.write(new_pwmpos); //mogelijk moet dit -new_pwm zijn??? motordir1 = 1; - }*///overbodig!!! - break; + } + break;*///overbodig!!! } //end switch scope.set(0,motor1.getPosition()); scope.set(1,motor1.getPosition());