be80be
Well-Known Member
I can't for the life of me fine how to save a key press. I know how to use a switch and debounce it. I want to save it. like key 1 pressed save to SaveKeyPress key2 pressed save to SaveKeyPress and so on for 4 buttons
I tried it like this
If this part is right how do I read SaveKeyPress to turn on say GPIO,5
I tried it like this
Code:
cblock 0x20
SaveKeyPress
endc
Start:
banksel TRISIO
movlw ~(1<<GP1)
movwf TRISIO
Getkey:
banksel GPIO
movlw ~(1<<GP3) ;make GPIO,3 high
movwf GPIO
btfss GPIO,GP3 ; if button pressed (GP3 low)
movf SaveKeyPress ;saves key press ? I think. I know it set it
goto Getkey ;to f7 in mplab sim but is this right?
end