Question Swapping a Gameboy D-Pad with a 3DS Slider?

A comparator would be what you need, it compares two analog voltages and outputs either 1 or 0. This is a good example of how it works:
Opamp105.gif
 
Using the LM339, how would this be achieved?
In my head:
X+ goes to 5, 7.
Y+ to 9, 11.
VCC to 3
GND to 12
1, 2, 13, 14 goes to Up, Down, Left, Right on the Gameboy Board

Which leaves the inverting inputs (4, 6, 8, 10)

What would be connected to these? Would they get resistors going to GND since the slider operates on voltage?
lm339-quad-comparator-ic.png
 
VCC to 3, GND to 12, X to 5 and 6, Y to 9 and 10.

For going down and left, you want to check the stick is below a certain voltage instead of above, so you would need to swap the inverting and noninverting input. Then you would need to make 2 voltage dividers to get the voltages you would want for up/down and left/right. Something like 1/4 VCC and 3/4 VCC would probably be good. You'll also need a NPN transistor for each button (since when you press a button it is pulled to ground), that is shown in the bottom right. Here is an example (L/H=low/high output from the voltage dividers, I was running out of room :P):

stick_to_button.png
 
Thanks for this. It's a lot to take in but I understand it at least.

So I'd be looking at trying to get 1.2v on the low side and 3.7 on the high side. If the voltage being supplied to the slider is already 3.8v (max), would I even need a resistor on the high side?

I ask because what I'm (attempting) to do this on is a Gameboy Pocket running off a DSi Battery which ends up with a max of 3.87v.
 
Yes you need the resistors as I drew them, those voltage numbers you calculated are wrong, vcc in your case would be the voltage the system is running on, it's not always a fixed 5v.
 
Alright. Thanks for that info. I've got a big resistor pack coming in next week along with the slider. Just gotta get an LM339 now. Thanks for your help, Cheese!
 
Back
Top