How to interface a rotary potentiometer with the propeller?
I'd like to interface (2) rotary position potentiometers with the propeller. They are 0-9 position potentiometers and I'd want the propeller to be able to interpret an integer from the varying resistance or voltage.
Anyone ever done this? Do you have a code and schematic example?
Anyone ever done this? Do you have a code and schematic example?

Comments
www.parallax.com/tabid/832/Default.aspx
Schematic given for this circuit is not quite correct in that a resistor is required between the pot wiper and the propeller pin to prevent a direct short on the pin when the pot wiper is at grounded end of pot.I have used a 330 ohm resistor in the past.
Gerry
Post Edited (Gerry Keely) : 7/19/2010 7:43:36 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
http://forums.parallax.com/forums/default.aspx?f=25&m=261327&g=269023#m269023
var long sample pub ADC(adcPinNo, fbPinNo, bits) | waitTime, cycles, oldSample ' adcPinNo and fbPinNo are the I/O pin numbers used for the analog ' to digital conversion as discussed in the comments in ADC.spin. bits ' is the number of bits to be used for the conversion. Note that the ' minimum number of bits in Spin would probably be 8. ' Note that, since Spin is much slower than assembly, the minimum ' sample time is much greater in Spin than in the assembly code. oldSample~ ' Initialize variables and registers cycles := |< bits - 1 dira := |< fbPinNo ctra := adcPinNo | (fbPinNo << 9) | (%01001_000 << 23) frqa := 1 waitTime := cnt ' must come just before the repeat for best initial accuracy repeat waitcnt(waitTime += cycles) ' wait for "cycles" system clocks sample := phsa - oldSample ' get count since last sample time oldSample += sample ' accumulate count to include this sample timehttp://obex.parallax.com/objects/488/
and I'm now trying to figure out my best course of action.
I'd like to control (2) 2.5 digit 7 segment LED's with the least amount of prop pins being used as possible with a BCD
Am I best to use a 4 pin BCD to give me 16 combinations, or (2) 4 pin BCD's? Maybe I could get away with (1) 5 pin BCD to drive both of them with the 32 binary posibilities?
If I understand the 4 pin LED driver BCD, it does the following, it takes 2^4 different binary combinations as an input and each combination will represent a different output that corresponds to a number on the 7 segment LED, is my understanding correct?
I'd also like to have the ability for analog values as inputs, someone asked if the prop uses SPI or IC2 as an interface, and I wasn't sure what to say. Are there certain ADC's that are better compatible with the propeller than others, a millisecond is more than enough speed for me and 2^4 is enough resolution.
Post Edited (turbosupra) : 7/28/2010 6:34:00 PM GMT
There is a later version I will try to find it again
There is another link: http://forums.parallax.com/showthread.php?p=904925
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
Post Edited (ErNa) : 7/28/2010 12:24:39 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
http://forums.parallax.com/showthread.php?p=831833
outa[noparse][[/noparse]PotentiometerPIN] := RCState 'set pin high or low dira[noparse][[/noparse]PotentiometerPIN] := 1 'make I/O an output, charge waitcnt(5_000 + cnt) 'Wait for 1 ms to charge dira[noparse][[/noparse]PotentiometerPIN] := 0 'make I/O an input, discharge ClockCycles := cnt 'grab clock tick counter value WAITPEQ(1-RCState,|< PotentiometerPIN,0) 'wait until pin goes into the opposite state you wish to measure; State: 1=discharge 0=charge ClockCycles := cnt - ClockCycles - 30000 'see how many clock cycles passed until desired State changed ClockCycles #>= 0 'no less than 0 'change the amount you divide by to match your potentiometer.(this should be the only thing you need to adjust, you might need to change the charge time also) Waveform := ClockCycles / 55000 'This code makes sure the value being stored into the FX data is within HSS limits. '0 to 254 If byte[noparse][[/noparse]@fx][noparse][[/noparse]0] <> Waveform If Waveform < 1 byte[noparse][[/noparse]@fx][noparse][[/noparse]0] := 0 ElseIf Waveform > 254 byte[noparse][[/noparse]@fx][noparse][[/noparse]0] := 254 Else byte[noparse][[/noparse]@fx][noparse][[/noparse]0]:= Waveform