Button (Return count of autorepeat cycle)
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
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
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