Button command
mike_s
Posts: 42
I have made much progress with the microwave oven controller that I am working on but have come up with a problem in using the bs2 for this project.
In the routine for the timer I have added a pause which is bascially the start button embedded in the countdown sub.
However the pause is not consistent or requires holding the button for an extended period while the rest of the code continues back to the point where I have inserted the button read.
Is there another way of handling this function?
I see that with higher models of stamp there is a pollin command which checks the state of a pin between executing each statement which is ideal but can I get the bs2 to operate the same way by some magic in code?
·
In the routine for the timer I have added a pause which is bascially the start button embedded in the countdown sub.
However the pause is not consistent or requires holding the button for an extended period while the rest of the code continues back to the point where I have inserted the button read.
Is there another way of handling this function?
I see that with higher models of stamp there is a pollin command which checks the state of a pin between executing each statement which is ideal but can I get the bs2 to operate the same way by some magic in code?
·
Comments
· Let's see your button subroutine.
What's the flow -- at what point do you want to "engage"/start waving? With Dwnmin?
Post Edited (PJ Allen) : 1/15/2006 3:33:41 AM GMT
Main:
· DO
· · Do_Something_Important
·· ·ON task GOSUB Task0, Task1, Task2
·· ·task = task + 1 // 3
· LOOP
By breaking your code into small tasks you can interleave critical process in between.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'll see how the sample you've supplied works Jon.Thanks to both of you.
Main:
DO
Do_Something_Important
ON task GOSUB Task0, Task1, Task2
task = task + 1 // 3
LOOP
I'm not sure how the //3 affects task = task + 1
does this limit task to the values 0-2?
If so that is something I was unaware of and gives me a new method.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax