Go to Post Karthik was never one to shy away from the spotlight (often to the chagrin of anyone within sight or earshot of him :p ). - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-02-2016, 13:13
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 139
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Is my Java code ok?

I see that you initialized the RobotDrive with the port numbers of your speed controllers. I believe that this will work correctly because you are using victors, but it would be better practice to initialize it with the two speed controllers you already initialized.

Code:
drive = new RobotDrive(drivermotor1, drivemotor2);
__________________


  #2   Spotlight this post!  
Unread 03-02-2016, 15:51
Stimpy1901 Stimpy1901 is offline
Registered User
AKA: Bobby
FRC #2348 (Cool Geeks)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Honolulu
Posts: 57
Stimpy1901 will become famous soon enough
Re: Is my Java code ok?

For us, although the code said "build successful" for code similar as shown below, it will throw an error (on the robot) and the driver station noted no code on the robot.

Code:
		drivemotor1 = new Victor(0);
		drivemotor2 = new Victor(2);
...
		drive = new RobotDrive(0, 2);
So use the correction shared by Joey:
Quote:
Originally Posted by Joey1939 View Post
Code:
drive = new RobotDrive(drivermotor1, drivemotor2);
Once we did this change, everything worked fine.
__________________
"The person who says it cannot be done should not interrupt the person doing it."
- Chinese Proverb
Closed Thread


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 05:33.

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