I'm having a hard time trying to do this. this is my configuration and code so far if anyone can help:
hardware: PIC16F84
PORTB.2 has a pullup resistor to VCC
pushbutton switch connected to PORTB.2 to gnd.
I inserted 'high pushbutton' because once i press the button, the output port did not automatically go back to VCC afterwards (right?, wrong?)
CounterA var Byte 'for counter
PushButton var PORTB.2
If PushButton=0 then
CounterA=CounterA+1
pause 10
high pushbutton
Pause 10
While Pushbutton=0:Wend
Lcdout $fe, 1, "Button Presses =" ' Clear LCD screen
Lcdout $FE, $c0, Countera
Pause 2000
endif
Bookmarks