i never use Button statement. I prefer to use IF THEN or While Wend statement
Code:
TRISA=255
TRISB=0
IF PORTA.0 then ' if push button on PORTA.0 is pressed
PORTB.0=1 ' set PORTB.0 to 1
while PORTA.0 ' wait untill push button is release
wend
pause 50 ' debounce delay
endif
Be sure you refer to the great PIN... what your PIN statement refer to? Use the pin name make your code more readable or use alias
Code:
PushButton1 var PORTA.0
if PushButton1 then
' do something here
endif
Last edited by mister_e; - 29th March 2005 at 04:42.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks