Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard or joystick- tank control — Parallax Forums

Keyboard or joystick- tank control

GookaGooka Posts: 2
edited 2010-12-16 08:44 in BASIC Stamp
Hey Everyone,

I've build three robots before, but I'm new to the forum!

I'm busy working on a tank like robot with a BS2 module that consists essentially of the processor, two 360 servos, a few sensors, a battery pack and a 180 servo that controls the turret! It is all contained in a foam model tank body that is very light and quite strong!

I wanna control it through the COM port (i'm getting a Bluetooth module soon) using the keyboard or a joystick. So far I can control the forward, back, left, right movement of the actual bot with the WASD keys, but I can't add extra features or it starts having problems. I also don't know how to use my joystick to control it!!!

Any help is much appreciated!

Comments

  • Spiral_72Spiral_72 Posts: 791
    edited 2010-12-15 13:16
    Is the joystick the analog type which plugs into a game port? (sound card?)

    Or is this a USB joystick?

    in the old days you could read a port for the X1, Y1 and buttons. I don't know if that still applies now..... actually I'm sure it does apply in some fashion.

    My best idea is Google the programming language and look for a library function or routine to use to read the joystick position. After that, it the same ol' send data just like you are doing now.
  • MINI-IZEDMINI-IZED Posts: 19
    edited 2010-12-15 17:57
    Do you have a Playstation (PS1 or PS2) controller handy? Check out this site. Also check out this site, scroll down to the the "PS2 Controlled Boe-Bot" check out his newly updated code. You could use one of the joysticks to steer and the other could control the turret!
  • GookaGooka Posts: 2
    edited 2010-12-16 08:44
    Thatnks guys that helps a lot! I forgot to mention it but a playstation controller was one of my other ideas, I've got a whole lot handy! Thanks for the links too!
Sign In or Register to comment.