PDA

View Full Version : Using PING and Digital Pot at same time.



TonyA
01-25-2006, 12:20 AM
Hi,

Could the BS2 read input from the PING and also control a digital pot at the same time?
I'm trying to have the value of the PING control the output of a digital pot.

PULSIN PING
Distance = x
x = digital pot output in k Ohms

Thanks for any info.

Tony

Chris Savage
01-25-2006, 12:23 AM
Tony,

It wouldn't be at the same exact time (The BS2 is single-tasking), but you could take the data from the PING))) and use it to adjust the Digital POT. It may require some scaling of the data.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

TonyA
01-25-2006, 12:26 AM
Hi Chris,

Would it be as fast as if I used an analog pot (as an input to the BS2 using RCTIME) to adjust the output of a digital pot?

Tony

Jon Williams
01-25-2006, 02:19 AM
Probably not quite as fast, Tony, but that may work to your advantage and provide a (subtle) bit of filtering -- mechanical pots can be "noisy."

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Chris Savage
01-25-2006, 02:27 AM
Tony,

The speed of the updates to your digital POT will be directly related to the distance from the PING))) sensor, since things farther away take longer to return a pulse. You will find the closer something is to the PING))) the quicker it returns the pulse. But the there's the interface to the digital POT. If it's synchronous serial (SPI) then you will have to SHIFOUT the data to it, whereas if it's a pulse up or pulse down type, then you have to generate the correct number of pulses. This also takes time.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

TonyA
01-25-2006, 03:20 AM
Hi,

Ok, I understand, Thank you.

Tony