Good question, well the "pot" I'm speaking of is really a voltage divider strip, like one of those force sensitive resistor strips, however made as a voltage divider rather than a variable resistor. I said "pot" just to simplify the explaination of my example since in this scenario it really can be any kind of analog sensor input to the Pic.
However, this strip I'm speaking of is essentially a voltage divider used as a ribbon controller for electronic musical instruments. It can be wired to output a resistance, but not enough OHMS to control my analog oscillator circuit.
The problem is I want to use this voltage divider strip (ribbon controller)
to control an analog sound generating circuit (an oscillator). The voltage divider strip won't do the job if connected directly to the analog ocsillator circuit. So I would like to connect this voltage divider strip to the pic and have the pic control the digital pot, and the digital pot control the analog oscillator.
In addition, I'll also be able to do some things with the digital pot (like switching it on and off to create stacatto effects, etc.) that an analog sensor wired directly to the analog circuit couldn't do.
So essentially I can also do some tricks by having the pic control the pot on my analog oscillator circuit.
I'm thinking if I just remove the section of code where Mister-E wrote in the above posted code:
for wiper = 0 to 255 'wiper is the variable written to the pot in the shiftout command
with instead:
ADCin 1, ADCVar 'Read voltage divider strip on pin 3
WIPER = ADCVar / x 'scale the voltage divider strip to get 0-255; "x" is a number I'll use to scale the value for "Wiper"
if wiper > 255 then 'if the reading goes above 255 look for new reading
goto Start
endif
and then do this:
shiftout si,clk, MSBFIRST,[WriteOnPot0, WIPER] ' Write to Digital Pot
I'm thinking this might be a starting point, but haven't tried it yet.
Thanks again,
Tony A
Bookmarks