I tried lookup-look down method but I don't realy understand
but i found an over way:
EEPROM 0,[1,9,7,1]; my code
; variable declaration here
; port A declaration here
debut:
code=0
decodage:
PORTB.0 = high
If PORTB.4 = then touche= 1
If PORTB.5 = then touche= 2
If PORTB.6 = then touche= 3
If PORTB.7 = then touche= A
PORTB.0 = low
PORTB.1 = HIGH
If PORTB.4 = then touche= 4
If PORTB.5 = then touche= 5
If PORTB.6 = then touche= 6
If PORTB.7 = then touche= B
ETC....
branch code,[c1,c2,c3,c4]
c1:
read 0,b10
if b10=touche then code=1 goto decodage
else goto bad
c2:
read 1,b11
if b11=touche then code=2 goto decodage
else goto bad
c3:
read 2,b12
if b12=touche then code=3 goto decodage
else goto bad
c4:
read 3,b13
if b13=touche then goto good
else bad
after that is very simple
do you think is good? I didn't test this code yet, but I will this weekend.
Bookmarks