ahh!!! so remove the pullup resistor then and hope the chip isn't fried? does the rest of the code look ok?
ahh!!! so remove the pullup resistor then and hope the chip isn't fried? does the rest of the code look ok?
Keep the resistor - a good value is 10k
CounterA var Byte 'for counter
PushButton var PORTB.2
CounterA=0 ' will be an undefined value on startup
Start:
If PushButton=0 then
CounterA=CounterA+1
Lcdout $fe, 1, "Button Presses =" ' Clear LCD screen
Lcdout $FE, $c0, Countera
While Pushbutton=0:Wend
Pause 2000
endif
goto start ' must tell the program where to go otherwise it will crash
hmm, still not working. i think i need to try to setup an interrupt. this way regardless of what the program is doing it'll record the button press. i'll poke around the forums and see what i can learn
Thanks alot for your help!![]()
Bookmarks