Shop OBEX P1 Docs P2 Docs Learn Events
:help: Relay controller using 2 Pots (basic stamp HWboard) — Parallax Forums

:help: Relay controller using 2 Pots (basic stamp HWboard)

spudduditspuddudit Posts: 10
edited 2011-04-26 12:19 in BASIC Stamp
I'm trying to build a time lapse controller for my DSLR. the idea is to have 2 pots, one that controls the delay between pulses to the relay and a second to control how long the relay stays on. I have built a similar project using switches but that only allowed me 6 different delays and i had no control over how long the relay was closed for.

the camera has the ability to auto focus with a second relay; I used 2 relays and wrote the code so relay one would close then wait while relay 2 closed triggering the shutter. then both off for ...delay

basicly any help on the code that would allow 2 pots to flash an LED then i can sub LEDs for relay/driver.

(basic stamp homework board)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-04-26 12:19
    First you have to read the pots' values. You'd use the RCTIME statement for that. There are examples of this in the Stamp Manual and the help files of the Stamp Editor. Once you get a range of values for each, you'll need to compute the on and off times in milliseconds. You'd use a HIGH <pin> statement to turn the LED on and a LOW <pin> statement to turn the LED off (see the Stamp Manual for details. You'd use a PAUSE statement to provide the delays like this:
    DO
    ' Read the pot values using RCTIMEs
       HIGH ledPin
       PAUSE onTime
       LOW ledPin
       PAUSE offTime
    LOOP
    
Sign In or Register to comment.