View Single Post
  #9   Spotlight this post!  
Unread 15-12-2011, 20:52
ericbarch's Avatar
ericbarch ericbarch is offline
221 Robotic Systems Engineer
FRC #0027 (Team Rush)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Clarkston, MI
Posts: 15
ericbarch is a jewel in the roughericbarch is a jewel in the roughericbarch is a jewel in the roughericbarch is a jewel in the rough
Send a message via AIM to ericbarch
Re: Arduino Board and FRC Victors

Just wanted to throw in my 2 cents. I've been working with ajlapp to design an Arduino based control system and we've learned a few things along the way.

Your best bet is to go with whatever language you're most comfortable on your PC (Visual Basic, Java, Python, LabView, etc...). There are plenty of great libraries out there for each of those languages that support reading in USB controllers and make it very simple. I personally use Java along with the JInput USB library: http://www.newdawnsoftware.com/resources/jinput/ If needed I can provide all of the source code to get the basic values using JInput. All you need to do once you have the values is write it out onto the USB serial port that the Arduino is connected to.

It's up to you how you want to write the values, but one way would be using a delimiter or a marker character that tells the arduino that a new value from the joystick is coming through. All modern programming languages should have a simple library or method of writing out to any connected serial port.

The nice thing about doing it this way is that you could very easily replace the wired USB connection with a XBee shield and XBee USB adapter (http://www.sparkfun.com/products/9819) down the line to go wireless.
__________________
Eric Barch
221 Robotic Systems
Controls Engineer
http://team221.com