View Single Post
Old 09-23-2013, 02:09 PM   #13 (permalink)
t vago
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 830
Thanked 708 Times in 456 Posts
My code has the button detection in the ADC interrupt handler, operating as you had described, nickdigger. My FIR filtering routine and my analog pin channel switching routine were not playing very nicely with each other, which interfered with the analog button signal timing, which caused the software to recognize all keypresses as long keypresses. I stripped out the FIR filter for now. Currently working on reintegrating FIR filtering.

In the meantime, both short- and long-button press functionality is retained.

I got the code to work with a 5 button configuration. This should allow for adding something along the lines of a Parallax 5-position switch.



I also changed the code to more easily accommodate recognizing more than 3 different buttons.
  Reply With Quote