### Author Topic: wiring joystick to bs2  (Read 1800 times)

0 Members and 1 Guest are viewing this topic.

#### ang5t

• Jr. Member
• Posts: 34
##### wiring joystick to bs2
« on: September 21, 2008, 01:11:58 AM »
Hey there. I've been messing with the parallax basic stamp for a little while now and am enjoying making various autonomous programs for it to run, but I really want to be able to control it with a joy stick, (not a PS2 controller). it is currently built kinda like the \$50 robot in build. I have the wiring figured out for the most part. They are:
red = power, (currently taking about 5V+)
black = ground
orange = trigger
yellow = button 2
green = button 3
white = button 4
brown = y axis
grey = x axis
purple = not 100% sure, but closes circuit after button press opens it.

I have the buttons pretty much figured out, my question is about the x and y axis pots. I have wired them to my breadboard as I would any other pot or resistor, but cannot get a reading from them. I have googled this and have found info on programing, but not on the hardwiring. Any help is appreciated.
So if the blue wire goes here, then that means...(bzzzt) oops....

#### paulstreats

• Supreme Robot
• Posts: 1,381
##### Re: wiring joystick to bs2
« Reply #1 on: September 22, 2008, 04:59:43 AM »
You need to create a voltage divider circuit so you can read them with the a/d converter. Look at how the photoresistors on the \$50 robot are wired, with an extra resistor.

+5v ------------------POT--------------Resistor---------------GND
|
|
----------------- to a/d port on mcu

POT's vary the amount of current wheras an a/d port needs a varying voltage. by making the circuit like above, the changes in current will also reflect in a change in the voltage.

You'll have to try different resistor values to get one that works well for yourself

• Jr. Member
• Posts: 34