In SX Microcontrollers, SX/B Compiler and SX-Key Tool, ALTITUDEAP wrote: Can anyone point me in the right direction for debouncing the kepad example in the SX/B help file [code] GET_KEY: tmpB1 = 0 ' reset keyboard value Keys = %0000_0111 ' activate first row TRIS_Keys = %1111_0000 ' refresh IO state PLP_Keys = %0000_1111 ' pull-up input pins FOR tmpB2 = 1 TO 4 ' scan four rows IF Col1 = Yes THEN EXIT ' check buttons on column INC tmpB1 ' update key value IF Col2 = Yes THEN EXIT INC tmpB1 IF Col3 = Yes THEN EXIT INC tmpB1 IF Col4 = Yes THEN EXIT INC tmpB1 Keys = Keys >> 1 ' select next row Keys = Keys | %0000_1000 ' clear previous row NEXT RETURN tmpB1 [/code] This is the pertinate code snippet i believe. I know that i need to sample the value and make sure that i get the same value for atleast a 2 cycles. Any body done this before? ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=151224 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)