Go to Post I was considering letting Big Mike bearhug me for the warmth. - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #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: 102
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
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:28.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi