In fact you MUST use some low value for column, let's say 100-300 ohms. 4.7K is way too high. The PIC don't detect the LOW level signal. In best case the LOW level will be 2.5 volts... too high for a LOW level signal
Refer tosection 18.4 of your datasheet for that.
You can even remove the column resistor and plug it directly... it will work but it's not really recommended.
Another thing, you must disable analog comparator too on PORTA
Code:
ADCON1=$0F ' Disable AD converters
CMCON =7 ' Disable analog comparator
About now?
PS: you can remove the DEFINE KEYPAD_AUTOREPEAT line. If you don't write it, the program will set it to off for you. This refer to that section of the include file
Code:
@ ifndef KEYPAD_AUTOREPEAT ' If AutoRepeat is not DEFINE
repeat
Gosub readcol ' Wait until
until KeyTemp=keymask ' Key is released
@ endif
Last edited by mister_e; - 14th April 2006 at 04:02.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks