
Originally Posted by
jonas2
Hello
I have a problem with this program for managing a keypad.
when I press a key such as 1, it displays "1111" when I
supported once the?
thank you
Hi Jonas2,
I see 2 things I question:
1. IF i = 4 THEN GOTO confirm ' code complet ? oui confirme
0 to 3 so it should be complete @ 3
2. You are exiting a for next loop in a rude fashion. I would tell the loop row = 3 and then gosub. IMHO
Like so
Code:
FOR row = 0 TO 3 ' 4 rows in keypad
PORTB = 0 ' All output-pins low
TRISB = (DCD row) ^ $ff ' Set one row pin to output
col = PORTB >> 4 ' Read columns
IF col != $f THEN row = 3 ' If any key own, exit
NEXT row
Gosub gokey
return
It just clears the stack. AND Maybe your pause 100 is faster than your key finger too
Last edited by Archangel; - 13th August 2009 at 22:25.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks