Friday, December 23, 2011

Moving to millisecond polling and added keyboard strokes

In the past few days, I have almost completely re-coded the majority of the capacitive touch buttons detection code.  Instead of counting CPU cycles, it is now based upon timetamps.  Each button's polling rate can now be specified in milliseconds.  This greatly helps manage CPU resources to ensure that each button gets the attention it needs without hogging up resources to do it.  In addition, I added a key-to-pin mapping array that allows the pins to be remapped easily to whatever you want that particular button tied to a pin to be doing.  These changes have added ease of use and increased overall performance to put CPU resources to use where it is most needed and stopped wasting CPU cycles on less important things.

Now, when I say whatever I want that button to do, I also made vast improvements here as well.  Teensyduino allows the Teensy board to interface as a keyboard+mouse composite device to the computer.  That being the case, I can now send both normal mouse clicks and keyboard strokes.  I took extra care to be sure that I can send multiple keyboard keys pressed at the same time too, so now up to six buttons can be sent at the same time.  As a test, I put a new fourth button on the trackball for my pinky finger to use and played WoW for three hours.  I was able to map this to the F4 key and it works perfectly.  I was able to ressurect fallen players while in combat with my pinky!

In addition to these changes, I have stopped development on the scroll wheel.  The scroll wheel with it's opto-interrupters was working perfectly, however it was a bit on the large and bulky size.  In place of where it would be, I simply designed a new middle mouse button that has smaller half-sized touch pads above and below the middle mouse button that allow for scrolling.  Now that I can control the polling rate, I can control the scroll speed up and down the page which is awesome.  A nice, neat and elegant solution to scrolling that has no moving parts and is ultra compact. 

1 comment:

  1. That's awesome! Nice substitution to eliminate moving parts. Thanks for keeping everyone posted on your progress.

    ReplyDelete