Motors

Motors Control:

.

motors(); motors(leftSpeed,RightSpeed); //negative numbers go backward. Values accepted -255 to 255. 0 stops motor.

This function controls Spirit's motors. Values range between -255 and 255. Two values are passed - the value for the left motor speed and the right motor speed. Negative numbers make the motor turn backward and positive numbers make the motor turn forward. Zero values stop the corresponding motor.

WARNING NOTE: Spirit does not automatically detect edges by default. Be careful running motors if Spirit is on a surface like a table or desktop so it doesn't drive off and fall.

Last updated