bbnqond
09-26-2008, 03:52 PM
Dear all,
I am currently work on a project using BS2P24 and I would like to seek help here.
I want to doing something like this:
I have connected an active low button to P8 of the stamp. When I press the button, go subroutine A; when i press the button again, stop A and go subroutine B. (Eg, When I press the button, the LED lit; when I press the button again, the LED turns off.)
I have thought of using the Button function, yet I failed to do so. The program succeed in going to subrountine A but failed to return to subrountine B when I pressed the button again. Below shows what I have written:
===========================
led PIN 9
but PIN 8
butWrk VAR Byte
Main:
BUTTON but, 0, 255, btnWrk, 0, B
DEBUG "flame on!"
HIGH 9
B:
LOW 9
DEBUG "Bye~"
============================
Could any big guy help me out?
Regards,
bbnqond
I am currently work on a project using BS2P24 and I would like to seek help here.
I want to doing something like this:
I have connected an active low button to P8 of the stamp. When I press the button, go subroutine A; when i press the button again, stop A and go subroutine B. (Eg, When I press the button, the LED lit; when I press the button again, the LED turns off.)
I have thought of using the Button function, yet I failed to do so. The program succeed in going to subrountine A but failed to return to subrountine B when I pressed the button again. Below shows what I have written:
===========================
led PIN 9
but PIN 8
butWrk VAR Byte
Main:
BUTTON but, 0, 255, btnWrk, 0, B
DEBUG "flame on!"
HIGH 9
B:
LOW 9
DEBUG "Bye~"
============================
Could any big guy help me out?
Regards,
bbnqond