Arduino Function: RobotControl.motorsWrite

Description

Controls the speed and direction of the two motors connected to the robot's wheels. The function motorsWrite() needs values between -255 and 255. If the value is greater than 0, the wheel turns forward. If less than 0, the motor turns backwards.

Syntax

Robot.motorsWrite(speedLeft, speedRight)

Parameters

The function motorsWrite() needs values between -255 and 255. *speedLeft: the speed of left wheel *speedRight: the speed of right wheel

Examples

#include 

void setup(){
 Robot.begin();
}
void loop(){
 Robot.motorsWrite(255,255); //Make the robot go forward, full speed
 delay(1000);
 Robot.motorsWrite(0,0); //Make the robot stop
 delay(1000);
 Robot.motorsWrite(255,-255);//Make the robot rotate right, full speed
 delay(1000);
 Robot.motorsWrite(0,0); //Make the robot stop
 delay(1000);
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc