View Single Post
  #1   Spotlight this post!  
Unread 15-02-2008, 05:09
Japper's Avatar
Japper Japper is offline
Registered User
FRC #3692 (RocknRobots)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Rutland Wisconsin
Posts: 147
Japper has a spectacular aura aboutJapper has a spectacular aura about
Simulating a potentiometer

Ok, this might sound like a dumb question but how can I simulate a potentiometer with a switch? (sorry it is late and I am not thinking clearly but I do want to do this and without using a digital pot...)

I want to make a simple control test box that does not require any changes to the software in which I can be able to plug in a SPDT switch into the y port and have the OI read either 0, 127, or 255, unfortunately, I will not have access to the OI until after I build this... so I am looking for ideas now before I arrive on site to try this test box.

I am using a 2 position switch with (SPDT with off in the middle) and I took a 50 k ohm resistor and connected it between the switch common (port Y signal) and the wiper (+5 volts) so that in the off position it should read like a mid-range 100 k ohm pot (giving me a 127, I hope). In one position it is connected to the +5 volts wiper which should read as a 255, but with the 50 K ohm in place, I will only get either a 255 or a 127...

I was contemplating not putting the 50 K ohm in there at all and tying one wiper to +5v and the other to ground but because I don't know how the OI is internally wired to the Y port line, I am not sure if in this configuration whether the P_Y port will read the open switch like a mid range pot at 127....

Any ideas on how to set this switch up so that I can read a 0, 127, & 255?


Thanks
Attached Images
File Type: bmp joystick switch.bmp (14.2 KB, 51 views)