I found this interesting.
http://makeatronics.blogspot.it/2013...ture-with.html
is your "re " a 20 count per turn with indents ? the 10 for a $1 ones I got from ebay have enough contact bounce to start a spring factory but the inherent software filtering of the above code does an amazing job on them 1 (4k7 pu r's and .1uFs included). I have not ported this to pbp but have for mikro c and xc8 if that helps
http://www.circuitsathome.com/mcu/re...age-1#comments
this link has some other insights
basically you just need to adjust your re count using this current value / old value matrix (illegal values [bounces] are just ignored )




Bookmarks