Shop OBEX P1 Docs P2 Docs Learn Events
Using PING and Digital Pot at same time. — Parallax Forums

Using PING and Digital Pot at same time.

TonyATonyA Posts: 226
edited 2006-01-24 19:20 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-24 16:23
    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
  • TonyATonyA Posts: 226
    edited 2006-01-24 16:26
    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 WilliamsJon Williams Posts: 6,491
    edited 2006-01-24 18:19
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-24 18:27
    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
  • TonyATonyA Posts: 226
    edited 2006-01-24 19:20
    Hi,

    Ok, I understand, Thank you.

    Tony
Sign In or Register to comment.