3. Step 2 – Save as MyIRRobotControl
MyIRRobotControl
4. Keep in mind
We want number pad button 3 to be
pivot right forward, meaning go forward
and right.
A pivot right forward means the right
wheel is stopped and the left wheel is
turning counterclockwise.
The button on the remote control is the
number 3. The command for this button
is 2.
1 2 3
4 5 6
7 8 9
* 0 enter
Pivot Right
Forward button
5. Step 3 – Add MOTOR_PIVOTRIGHT_FORWARD button definition
Added Line
6. Step 4 – Add Command Case to setDirection()
Added Case
7. Step 5 – Add pivotRightForward() method
New Method
8. That’s it. Save the sketch then upload. The
number 3 should now cause your robot to pivot
forward and to the right.