Joystick contorlled what??
Hi all,
I haven't been very active in the robotics scene lately and im looking to get back into it.
i want to build a robot using a laptop, BOE, 2x HB25's, USB joy stick, 2 xbees, etc.
i want to have a visual basic or java program to get data from the joystick and send them via the "flash fly XBEE kit" to the robot to control movement, pan/tilt camera, robotic arm, etc.
Please help!
Miles
I haven't been very active in the robotics scene lately and im looking to get back into it.
i want to build a robot using a laptop, BOE, 2x HB25's, USB joy stick, 2 xbees, etc.
i want to have a visual basic or java program to get data from the joystick and send them via the "flash fly XBEE kit" to the robot to control movement, pan/tilt camera, robotic arm, etc.
Please help!
Miles
Comments
http://myrobotlab.org/
Sounds like you're looking for some fun!?
I always think it's best that our Customer/Forumistas here take the lead in advising each other what the best components are for a particular project. Hopefully they recommend our products mostly, but often they don't because another mfr's part may be more well suited to your application.
That being said, and for the sake of getting the flow of information started, take a look at Madeusa. In fact, here's a thread with some videos on how we make "her" right here in Rocklin, CA.
So with that, I'll step aside for a bit and let our customers (and long time friends) give you ideas about how to use some of the things we make to accomplish your goals!
What about it erco? Gordon? Maxwin? Vanmunch? Whit? Phil? Amanda? and all you other Robot Developer Extradonairs (you know who you are) - Speak Up! and help get Miles going!
-Matt
Thanks again,
Miles
'joystick transmitter program "rfbot3" by Dave Ratcliff 'ratronic' 7/17/11 'for use with rf3.spin 'use either parallax #27980 transmitter or #27982 transceiver SetCommPort 8,br9600 'set com port # where transmitter or transceiver hooked to loop: Joysticke 1,j x = round(j[0,0]/257) y = round(j[1,0]/257) z = round(j[3,0]/257) s = round(j[2,0]/257) b = j[6,0] cs = (x+y+z+s+b) & 255 serialout "!~#}",x,y,z,s,b,cs goto loop:
Thanks,
Miles
Here are two links you may wish to look at, both contain examples for VB Express. The first discusses a joystick interface and the second discusses various serial routines between a PC and BS2. There should be enough information to help you get started quickly.
http://forums.parallax.com/showthread.php?111312-Game-Controller-Interface
http://forums.parallax.com/showthread.php?96973-VB-Express-to-Stamp-Template
Jeff T.
SetCommPort 8,br9600 'set com port # where transmitter or transceiver hooked to loop: Joysticke 1,j x = round(j[0,0]/257) serialout "!",x goto loop:
This is really for all the people out there that have the cheaper 9600 baud transmitters and receivers and are using a BS2, but maybe you can use with the xbee's.
These 2 examples use a computer with a usb joystick and transmit the joystick values to the BS2. Make sure to properly interface your transmitter/receiver to your computer/robot.
' {$STAMP BS2} ' {$PBASIC 2.5} 'constants rcvpin CON 5 'P5 - pin where receiver(xbee?) attached baud CON 84 '9600baud - 8bit,no parity,true(non-inverted) for bs2 'variables array VAR Byte(2) 'checksumed variables x,y,b array1 VAR Byte(3) 'received variables x,y,b,cs i VAR Nib 'index counter 'program DO 'execute until LOOP then come back and run again continuously GOSUB joystick 'get x axis,y axis,buttons value and checksum from receiver(xbee?) DEBUG HOME 'home cursor DEBUG "X = ",DEC array(0)," ",CR 'show x axis array(0) DEBUG "Y = ",DEC array(1)," ",CR 'show y axis array(1) DEBUG "Button = ",DEC array(2)," ",CR 'show buttons value array(2) LOOP joystick: 'joystick receiver subroutine SERIN rcvpin, baud,[WAIT("!~#}"), array1(0),array1(1),array1(2),array1(3)] 'wait for flag then receive x,y,b, and checksum IF (array1(0)+array1(1)+array1(2))&255 = array1(3) THEN GOSUB transfer 'if received checksum matches calculated checksum then transfer array1 to array RETURN transfer: 'transfer array1 to array FOR i = 0 TO 2 array(i) = array1(i) NEXT RETURN
'joystick transmitter program "rfbot4" by Dave Ratcliff 'ratronic' 8/14/11 'can use either parallax #27980 transmitter or #27982 transceiver SetCommPort 8,br9600 'set comport#,baudrate where transmitter or transceiver interfaced to loop: Joysticke 1,j 'get usb joystick info into array j x = round(j[0,0]/257) 'get x axis and round to a byte 0-255 y = round(j[1,0]/257) 'get y axis and round to a byte 0-255 b = j[6,0] 'get buttons value cs = (x+y+b) & 255 'calculate checksum serialout "!~#}",x,y,b,cs 'send out x,y,b and cs(checksum) xystring 0,0,"X Axis = ",x,spaces(20) 'display joystick values on computer screen xystring 0,40,"Y Axis = ",y,spaces(20) xystring 0,80,"Buttons = ",b,spaces(20) goto loop: