Go to Post As long as the competition gets the attention of someone and drags them in, it doesn't matter how they get there. - Andy Grady [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 29-05-2011, 17:22
wmarshall wmarshall is offline
Registered User
FRC #0011
 
Join Date: Jan 2011
Location: New Jersey
Posts: 8
wmarshall will become famous soon enough
Re: separate classes

First, check the manifest file in the resources/META-INF/ folder. It should look something like this (note that MIDlet-Name can be basically whatever you want):
Code:
MIDlet-Name: ASimpleJavaBot
MIDlet-Version: 1.0.0
MIDlet-Vendor: FIRST
MIDlet-1: spike, , com.hedgehog.spike.spike
MicroEdition-Profile: IMP-1.0
MicroEdition-Configuration: CLDC-1.1
If that looks ok, then you should note that you code will throw a NullPointerException on robotInit(). You never instantiate RobotDrive.driver, as Eric mentioned, so any method call involving it will nuke the JVM from orbit. You probably don't need to call your drive methods twice (in RobotDrive.run() and spike.operatorControl()). In addition, I'm a bit confused by how you're attempting to drive your robot; you seem to be using three joysticks, using driver and secondary in RobotDrive.run(), driver and driver2 in spike.operatorControl(). Lastly, you may actually want to start the RobotDrive thread.

Java is a very object-oriented language, so you may want to investigate using static fields so that you don't have to instantiate your Inputs and Joysticks classes. Over here you can see our code. We made big steps in properly using Object Orientation to make our code not be a complete mess, and kinda succeeded.
Reply With Quote
 


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 09:37.

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