Shop OBEX P1 Docs P2 Docs Learn Events
Pulsout with digital pot — Parallax Forums

Pulsout with digital pot

rtmorrisrtmorris Posts: 31
edited 2006-02-08 17:23 in BASIC Stamp
In WAM 2.2 page 279, a program is introduced that is confusing.·· Within the chapter
the digial pot is pulsed on some pin for 2 microsecond:

pulsout 6, 1

However on pg. 279, a program is introduced that pulses the pin for 5 microseconds:

LOW UdPin ' Set U/D pin for Down.
FOR counter = 0 TO 128 ' Set tap to lowest position.
PULSOUT 6,5
PAUSE 1
NEXT

Why did the pulsout time period suddenly change, why not go by ones?
Also, I will be teaching this to High School Students, do you think that they will be able to come up with the exercise in the end on their own??· It seems a bit
tough to come up with the program to make the led respond to the light·in the room on their own.
-Rob Morris

Al

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-08 17:23
    Rob,

    ·· You may notice the PAUSE value also changed between the examples.· The width of the pulse is only one component of controlling the digital pot.· Another factor is speed of the pulses, and when the pulse width is shorter a longer pause is being used.· When the pulse was increased the pause was decreased.· At the speed of the BS2 the pulse width will have little effect on the pot except to increase the time it takes to pulse the line.· The pause however will directly affect the speed of the changes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.