Shop OBEX P1 Docs P2 Docs Learn Events
again button command — Parallax Forums

again button command

ArchiverArchiver Posts: 46,084
edited 2002-04-19 15:21 in General Discussion
Hello stampers

When I use multiple button commands to contol multiple inputs, do I have to
define a dedicated "workspace variable" for each button command or can they
share the same variable.

Thanks

Michel

Met vriendelijke groetjes,

> ************************************************
> Michel De Meester
> Biotechnisch Onderhoud
> Universitair Ziekenhuis Antwerpen
> Wilrijkstraat 10
> 2650 Edegem - B
> tel: ++32 (0)3 821 36 47
> e-mail: michel.de.meester@u...
>
> *************************************************
>
>

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-04-19 15:21
    Scanning multiple BUTTON commands is a bit tough. Below is a small subroutine
    that will let you scan and debounce four inputs (the program assumes inputs
    are active low -- remove the tilde [noparse][[/noparse]bitwise invert] operator if your inputs
    are active high).

    -- Jon Williams
    -- Applications Engineer, Parallax


    btnsIn VAR InA ' four inputs, pins 0 - 3
    btns VAR Nib ' debounced inputs
    x VAR Nib ' loop counter


    GetButtons:
    btns = %1111 ' enable all four inputs
    FOR x = 1 TO 10
    btns = btns & ~btnsIn ' test inputs
    PAUSE 5 ' delay between tests
    NEXT
    RETURN


    In a message dated 4/19/02 8:45:34 AM Central Daylight Time,
    Michel.De.Meester@u... writes:


    > When I use multiple button commands to contol multiple inputs, do I have to
    > define a dedicated "workspace variable" for each button command or can they
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.