|
Re: Tank Drive Talon SRX
On the left I see you are opening the two joysticks. That code should actualy be moved to the Begin.vi. As it is, the TeleOp.vi is inside a while loop on the Robot Main.vi. That means the joysticks are being opened over and over and over. When you move the Joystick Open code to the Begin.vi you can call each Joystick by its name in the TeleOp.vi. Also, you should change the refnum names to constants instead of controls.
On the upper right it looks like you are currently using a single joystick axis from a single joystick (JS0) to control two motors. One motor (the one with the error) has probably not been opened (hence the error). I'm going to assume you are trying to use two joysticks to control two motors. If that is the case, you can just delete the lower motor code and then copy and paste the joystick and motor code (not including the network table write code) and change the refnum names for the copy. Remember to open the second motor in the Begin.vi.
In addition to moving the Open VIs to the Begin.vi it is also good practice (although it may not be absolutely necessary. Maybe someone could weigh in on the importance.) to close the motors and joysticks in the finish.vi.
If these motors are drive motors, there is another way to go about controlling them as a unit. Just let us know if that is the case.
Another thing... Unless you are using a compressor and not any solenoids, you do not need ANY compressor code. The compressor will be activated automatically when you open a solenoid.
|