|
Re: Basic LabVIEW Arcade Drive Program
The default code is Arcade Drive.
It comes setup for 2 motor drive though, so you need to change that. - Create a Default Framework
- Open Begin.vi, then the block diagram
- Locate the Open 2 Motor icon.
- Right-click on Open 2 Motor and go to Replace -> All Palettes -> WPI Robotics Library -> RobotDrive and choose Open 4 Motor
- Delete the two PWM settings left over. There's a reason, really.
- Add constants for all four input nodes and set them to your other two motors. Okay so you're adding back the two PWMs you just deleted--there really is a reason.
- Right-click on each of the PWM inputs, go to Visible Items -> Label and let go. The name of the input will appear and you might want to drag it to the left side of the PWM constant. The reason for deleting the old PWMs was the labels would get updated.
- Set the PWMs to match where your 4 motors are.
- Create constants for the two Inverted nodes on the bottom of the Open 4 Motor icon.
- Set both the motors on one side of the robot be Inverted. If you guess wrong and the robot drives backwards instead of forwards, just go back into the code and reverse which side gets Inverted.
- Save, Build & Run as Startup
- In the Project Explorer window, at the bottom, you'll see Build Specifications. Expand that and you'll see FRC Robot Boot-up Deployment
- Right-click on FRC Robot Boot-up Deployment and choose Build
- Turn the robot on and connect to it
- Right-click on FRC Robot Boot-up Deployment again and choose Run as startup
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 01-02-2011 at 21:27.
|