
Minor BioRobotics BMT Hierbij publish ik mijn code public ter inspiratie voor komende jaarlagen. Het gaat om een serial robot met twee links en een haak als end-effector. Veel plezier ermee!
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 13:db1a8b51706b
- Parent:
- 12:f5dc65f1c27b
- Child:
- 14:236ae2d7ec41
--- a/main.cpp Tue Oct 29 14:56:19 2019 +0000 +++ b/main.cpp Tue Oct 29 16:13:50 2019 +0000 @@ -150,7 +150,7 @@ // Calibration motor 2 motor1DirectionPin=0; //direction of the motor motor1=1.0; - wait(0.05); + wait(0.1); while (abs(positie_verschil_motor1)>5) { motor1=0.2 ; @@ -165,15 +165,18 @@ // Calibration motor 2 motor2DirectionPin=0; //direction of the motor motor2=1.0; - wait(1); + wait(0.1); while (abs(positie_verschil_motor2)>5) { motor2=0.2 ; pc.printf("\r\n Motor2 kalibratie = %s", motor2_calibrated ? "true" : "false"); + led2=1; } motor2=0.0; + led2=0; motor2_calibrated=true; pc.printf("\r\n Motor2 kalibratie = %s", motor2_calibrated ? "true" : "false"); + } @@ -225,6 +228,8 @@ return P_motor2; } + + // 4.3 State-Machine ******************************************************* void state_machine() @@ -273,7 +278,7 @@ pc.printf("\r\n State: Demo"); led_blue.write(1); led_red.write(1); - led_green.write(0); //!=led_green.write(0); + led_green.write(0); break;