Thread: IO
View Single Post
  #6   Spotlight this post!  
Unread 12-06-2009, 15:13
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: IO

I did manage to find a joystick library for C a little while ago called libjsw. If you can't find anything else, you could use a C wrapper for this library. Basically, it uses structures for each joystick, pretty much just like the objects in java, so if you can find someone who's good enough with C to break it down, you could rewrite it in java without TOO much complication.

And I like your premise. I've got 5 old (and I mean OLD) laptops sitting around that I've been thinking about repurposing in just this way. If Puppy Linux proves to be too slow (can't imagine it would be that bad), and you need something more time-critical, might I suggest MINIX? It's one of the ORIGINAL Unix operating branches, and has been designed to be tiny. Just food for thought.

If you're not adverse to learning C, this project would probably be quite a bit easier for you. The libjsw library is written in C natively, and there are two functions in <asm/io.h> called inb() and outb() which can access any port on the computer using the hex address. The parallel port is generally 0x378 and 0x379 for write and read, respectively, I believe. There's a good tutorial for C control of the parallel port here. I have managed to run a small motor from a transistor amplifier directly from the parallel port using this method.

Good luck, sounds like fun! And let us know what you learn along the way, I'm going to see if I can convince our team to let me run our summer swerve drive project on Linux.