Joystick code for linux computer to send instructions to a Prop driven BOE-bot
J. A. Streich
Posts: 158
So, I've got a bot with prop, servos and XBee on a BOE chasis. (No SD, a bunch of IR LEDs and detecors are in the mail, and I'm looking to salvage an old optical mouse for dead reckoning). For now the bot is running Mike Green's code - http://forums.parallax.com/showthread.php?p=635533 ... It's a thing of true beauty.
So, I have an XBee attached to my EeePC (Debian Lenny) on the other side, and I had an old Logitech gamepad laying around. I've written a C program, using some sample code from the web andhave gotten the Bot to respond to the joystick.... There are delays and it seems to miss some events. Any improvements anyone has are welcome, and your free to play with it or use it as a starting point for your bots.
What it does in a nutshell...
Joystick inputs (-32,767 to 32,767) get turned into servo widths (1000 to 2000), formatted into FemtoBasic and sent to the XBee.
EDIT:
I suppose I should note... The code should work with any modern Linux Distro (newer kernels), any jpystick with multiple analog sticks (can be easily modified can use one analog stick so that the top left corner is full forward, and the lower left is full back), and could work with BOE (with XBee) with minor changes to the scale and translation.
Post Edited (J. A. Streich) : 2/9/2009 4:26:40 PM GMT
So, I have an XBee attached to my EeePC (Debian Lenny) on the other side, and I had an old Logitech gamepad laying around. I've written a C program, using some sample code from the web andhave gotten the Bot to respond to the joystick.... There are delays and it seems to miss some events. Any improvements anyone has are welcome, and your free to play with it or use it as a starting point for your bots.
What it does in a nutshell...
Joystick inputs (-32,767 to 32,767) get turned into servo widths (1000 to 2000), formatted into FemtoBasic and sent to the XBee.
EDIT:
I suppose I should note... The code should work with any modern Linux Distro (newer kernels), any jpystick with multiple analog sticks (can be easily modified can use one analog stick so that the top left corner is full forward, and the lower left is full back), and could work with BOE (with XBee) with minor changes to the scale and translation.
Post Edited (J. A. Streich) : 2/9/2009 4:26:40 PM GMT
Comments
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..