Torquewrench
08-21-2005, 09:55 PM
Hi,
I'm working on a controller circuit for a paintball gun that involves an LCD screen. I've borrowed heavily from NV #62 on using menus, and I had a question about how to treat the trigger button, which is a special case compared to the other buttons.
Here is a list of the buttons I'm dealing with:
Mode
Select
Safety
Trigger
In NV62 Jon Williams dealt with debouncing multiple inputs by ANDing a byte the inputs with a temp byte repeatedly. This definitely works for the mode, select, and safety, but for the trigger I'm looking for some special behavior I previously achieved using BUTTON.
The special behavior is this: The trigger is used three modes, semi, burst, and auto.
In semi the trigger should fire only once until released (BUTTON delay = 255 for no repeat)
In burst the trigger should fire multiple shots only once until released (BUTTON delay = 255 with a FOR loop)
In auto the trigger should fire continuously until released (BUTTON with a delay for auto-repeat)
How can I achieve this in my new code while I'm looking at these other buttons?
Thanks,
Phil
I'm working on a controller circuit for a paintball gun that involves an LCD screen. I've borrowed heavily from NV #62 on using menus, and I had a question about how to treat the trigger button, which is a special case compared to the other buttons.
Here is a list of the buttons I'm dealing with:
Mode
Select
Safety
Trigger
In NV62 Jon Williams dealt with debouncing multiple inputs by ANDing a byte the inputs with a temp byte repeatedly. This definitely works for the mode, select, and safety, but for the trigger I'm looking for some special behavior I previously achieved using BUTTON.
The special behavior is this: The trigger is used three modes, semi, burst, and auto.
In semi the trigger should fire only once until released (BUTTON delay = 255 for no repeat)
In burst the trigger should fire multiple shots only once until released (BUTTON delay = 255 with a FOR loop)
In auto the trigger should fire continuously until released (BUTTON with a delay for auto-repeat)
How can I achieve this in my new code while I'm looking at these other buttons?
Thanks,
Phil