Re: Digital touch Screen Combination lock
do you mean something like this
no need to wear out the eeprom
Code:
ANSELA = 0
DEFINE OSC 64
OSCCON = $70
OSCTUNE.6 = 1
TRISA = %11111100
led1 var porta.0 ; alias led1 to porta.0
led2 var porta.1 ; alias led2 to porta.1
x var bit ; tried to use X var as a bit in order to hold the value of the actual status of the pin.
x = 0 ; we write 0 to var X
loopy:
lata.0 = 1 ; we write 1 to lata.0
gosub holdmem ; gosub to holdmem
pause 500
led2 = x ; write the value of x to led2
pause 500
led1=0
@ nop
led2=0
pause 1000
goto loopy
holdmem:
x = led1 ; read the state of the porta.0 and place it in x
'x = lata.0 ;or read the state of the lata.0 and place it in x
return
goto loopy
Warning I'm not a teacher
Bookmarks