Otto Blockly; a fully integrated graphical programming for any type of Arduino projects, including robots, ready to install in your computer, it works offline and also online
The function to move forward or backward didn't stop after the delay.
For a symple program like that: The Otto wheels need to move forward by 1 second than stop by 1 second.
The function to move forward or backward didn't stop after the delay. For a symple program like that: The Otto wheels need to move forward by 1 second than stop by 1 second.
void loop() { motorControl (-45, -45, 1 ); delay(1*1000); }
In this exemple, Otto will run forever. Ther is no intuitive way to stop the Otto.
Maybe to change this situation, We can change the motorControl function.
Actual: void motorControl(int rightSpeed, int leftSpeed, int stepDelay) { rightServo.write(90 + rightSpeed); leftServo.write(90 - leftSpeed); delay(stepDelay*1000);}
Proposition: void motorControl(int rightSpeed, int leftSpeed, int stepDelay) { rightServo.write(90 + rightSpeed); leftServo.write(90 - leftSpeed); delay(stepDelay*1000);rightServo.write(90);leftServo.write(90);}