Download presentation
Presentation is loading. Please wait.
1
Programming a Servo By Joshua Shaw
2
From the last Power Points
We have previously added a While Loop We are now going to use it for programming the robot We have also added two motor programs An analog program A digital program
3
Servo Programming Now lets make a servo operate with the flip of the joystick on the Joystick Controller Go back to Joystick in the Function Block Click and drag the Joystick to Servo function to your While Loop and place it on the vertical line between the JoystickToMotor function box and the lower bracket box
4
Servo Programming cont’d
When you do this, another dialog box will appear For our example program Lets set the Channel to “2” and the Motor to “4” This is done by click the down arrow besides each of the boxes Click OK
5
Using the Joystick Controller – Channel 2
You will use the Channel 2 on the Joystick Controller Move the right joystick up or down to control the servo The servo will only move about 60º in either direction for a total of 120º
6
Servo Controlled by Buttons
We will now create a servo program that operates with buttons instead of the joystick Go to the Function Block Under the Joystick folder Click and drag the Joystick Digital to Servo onto the vertical line between the bracket boxes in the While Loop
7
Servo Controlled by buttons cont’d
The program for the servo in this example will look similar to the default The difference is that the Servo # will be “3” and not “2” Change the number by clicking on the down arrow Then click on the “3”
8
Completed Servo Controlled by Buttons Program
The final program for the servo will look like this Finally click OK
9
Using the Joystick Controller – Channel 5
You will use the Channel 5 buttons on the Joystick Controller Push the top left button to move the servo to the left Push the bottom left button to move the servo to the right When you let off of the button the servo will return to neutral To change the direction of the servo, first release the button being pushed.
10
Next PowerPoint The next PowerPoint is Programming a Wheel System
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.