Digital I/O Touch Detection Code Improvements

Digital I/O Touch Detection Code Improvements

I have been working with the same basic approach to digital touch detection since the inception of the Keyglove. That process goes something like this:

  1. Pull all touch points to logic high
  2. Select possible combination [X, Y] from touch definition array
  3. Set point [X] low
  4. Measure the level of point [Y], and if it is low, then touch combination [X, Y] is active
  5. Increment test combination index and go back to step #2 until complete

At first, this method of scanning to detect connectivity between arbitrary I/O pins without mechanical switches seemed wonderfully functional and easily implemented. I used Arduino’s built-in digitalWrite() and digitalRead() functions, which was the simple solution. It was also plenty fast enough at the time. However, it has a couple of now-obvious shortcomings, plus another not-so-obvious one which I am hoping that I diagnosed correctly.
Read more