hi i have just started to picbasic. i tried to control led by button but i could not be successful.
i wrote a code like this
DEFINE OSC 48
DEFINE RESET_ORG 800h
TRISB.3 = 0
TRISB.7 = 1
low portb.3
buttons:
if portb.7 = 0 then 'if button is pressed
high portb.3 'turn on led
endif
if portb.7 = 1 then
low portb.3
endif
goto button
end
but at this code only while i am pressing the button led turns on and when i pull my finger back from the button it turns off. but i want led to turn on up to next pressing of button. what should i do. thanks for help and sorry for my english
Bookmarks