Shop OBEX P1 Docs P2 Docs Learn Events
Using the button command on a bs2 — Parallax Forums

Using the button command on a bs2

dash8brjdash8brj Posts: 2
edited 2006-10-29 18:00 in BASIC Stamp
I am presently working on a automated time lapse photography controller that sets off the shutter on a DSLR at regular intervals.

However the button command has me perplexed, and there is no example in the manual.

My button commands keep getting "expected a label" error in pbasic. Here is my command for the up button:

BUTTON 0,0,255,100,switch,1,up

UP is my flag to notify the button scan routine that the up button is pressed. It sets push high (so the loop exits), and moves the cursor, or increments a variable e.g. bulb mode up by one second.

The button command here is Button pin0,downstate logic 0,delay debounce and no repeat, rate is 100 cycles of the loop, workspace is variable "switch", Target state is pressed, address is up

There are similar button commands for the down, left, right, shutter and help buttons.

Now what am I doing wrong (yes I have branches with these names)

While I wait for an answer to this confusing thing, I'll go and work on the bulb and delay routines.

Thanks in advance
Ben

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-10-29 07:31
    Ben -

    If SWITCH is defined as a single-use, unique variable, and UP is defined as a paragraph name, then the error isn't apparent. If that's the case, we'll need to see the entire program.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • dash8brjdash8brj Posts: 2
    edited 2006-10-29 18:00
    looks like I fixed it. I've worked out how to make this silly thing work - do all the different sections seperatly and then slowly merge them together [noparse]:)[/noparse]

    I have started from scratch beginning with the button routine. Now thats working, all i need to do is merge it with the display and shutter control routine.
Sign In or Register to comment.