Shop OBEX P1 Docs P2 Docs Learn Events
Button (Return count of autorepeat cycle) — Parallax Forums

Button (Return count of autorepeat cycle)

ArchiverArchiver Posts: 46,084
edited 2000-06-30 08:09 in General Discussion
Hi

For my project BS2, I want to be able to advance the stepper motor by
using the same button for 2 conditions below

A)button press once to advance the stepper motor by one
B)button held down(autorepeat mode) to advance the stepper motor by
the number of cycles of autorepeat it return when it is released.

1 __
A)0_____| |__________________________________ count 1


1 ___________________________________
B)0_____| |__ count of Autorepeat ?

How is the cycle timing is calculated ?
Is it in millesecond or microsecond ?

Thanks

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-06-30 08:09
    This is an example.
    write a code like:

    loop:
    if inX= 0 then loop 'program will stay here if pinX button is not high
    -use a pull down resistor
    ' put here your code to advance ONE step.
    ' put here any wanted pause to control auto repeat rate
    goto loop

    ACJacques


    Ken Edgeworth wrote:
    >
    > Hi
    >
    > For my project BS2, I want to be able to advance the stepper motor by
    > using the same button for 2 conditions below
    >
    > A)button press once to advance the stepper motor by one
    > B)button held down(autorepeat mode) to advance the stepper motor by
    > the number of cycles of autorepeat it return when it is released.
    >
    > 1 __
    > A)0_____| |__________________________________ count 1
    >
    > 1 ___________________________________
    > B)0_____| |__ count of Autorepeat ?
    >
    > How is the cycle timing is calculated ?
    > Is it in millesecond or microsecond ?
    >
    > Thanks
Sign In or Register to comment.