Lesson 18 – how to add a new button for pivot right Day 10 Lesson 18 – how to add a new button for pivot right
Step 1 – Open Lesson18HBridgeMotorControl
Step 2 – Save as MyIRRobotControl
Keep in mind Pivot Right Forward button 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.
Step 3 – Add MOTOR_PIVOTRIGHT_FORWARD button definition Added Line
Step 4 – Add Command Case to setDirection() Added Case
Step 5 – Add pivotRightForward() method New Method