keypad reader doesnt work :[
ohVaNiLLaGoRiLLa
Posts: 33
i am trying to run the 4x4 keypad demo but i cannot get it to work. i have the keypad hooked up correctly but all i get from the serial terminal is
this is the code for the demo
00000 0000 0000 0000 0000 0000000000000000
this is the code for the demo
{{ 4x4 Keypad Reader PST.spin Returns the entire 4x4 keypad matrix into a single WORD variable indicating which buttons are pressed. }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ text : "Parallax Serial Terminal" KP : "4x4 Keypad Reader" VAR word keypad PUB start ' Start PST text.start(115200) text.str(string(13,"4x4 Keypad Demo...")) text.position(1, 7) text.str(string(13,"RAW keypad value 'word'")) text.position(1, 13) text.str(string(13,"Note: Try pressing multiple keys")) repeat keypad := KP.ReadKeyPad '<-- One line command to read the 4x4 keypad text.position(5, 2) text.bin(keypad>>0, 4) 'Display 1st ROW text.position(5, 3) text.bin(keypad>>4, 4) 'Display 2nd ROW text.position(5, 4) text.bin(keypad>>8, 4) 'Display 3rd ROW text.position(5, 5) text.bin(keypad>>12, 4) 'Display 4th ROW text.position(5, 9) text.bin(keypad, 16) 'Display RAW keypad value
Comments
You could also use resistors as Larry suggests but I'm not sure if you can use the same object.