Thread: PLZ Fix error
View Single Post
  #1   Spotlight this post!  
Unread 16-02-2016, 11:31
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 103
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: PLZ Fix error

You are attempting to construct your Talon and Joystick objects too many times. Try constructing them just once in robotInit().

Code:
Joystick mXboxController; // this will drive the robot
Joystick controlStick; // this will be for function of the robot such as toggle the conveyor belt and etc.

Talon frontLeft;
Talon frontRight;
Talon rearRight;
Talon rearLeft;

public void robotInit() {	// this code will be ran each time we power on the robot

  // Construct joysticks here
  mXboxController = new Joystick(0); // depends on the usb connected to computer
  controlStick = new Joystick(1);

  // Construct Talons here
  frontLeft = new Talon(3);
  frontRight = new Talon(2);
  rearLeft = new Talon(0);
  rearRight = new Talon(1);
}
Hope that helps.
Reply With Quote