SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
#119182
I have read microchip's AN1298 "Capacitive Touch Using Only an ADC (CVD)" and through it really cool if it works and why the hell i bought dozen of MPR121QR2 on Sparkfun.

I have no way to program bunch of PICs (i have to make pic programmer yet) but i have mighty atmega-based Teensy board. So i give it a try. Half an hour and IT WORKED.

The only external parts used are a piece of enameled wire and breadboard.

Video: http://www.youtube.com/watch?v=tbCVrYJ-nJg

Here is the code:

https://github.com/ITikhonov/picfavr

ADC-Touch.py is a python script which controls teensy via usb and draws touch sensing data in graphical form on pc.

picfavr.s is a gnu assembler code for my usb interface to avr capable of reading byte from memory and writing byte to memory. Python script sends commands to it. This way i make it easy to experiment without wasting flash cycles.

cli.c is a linux-only (sorry) program which python uses to actually send commands to teensy.

If you are interested how to do that without all my mess with C just read ADC-Touch.py it's pretty straightforward what's going on on atmega side.

AN1298: http://www.microchip.com/stellent/idcpl ... e=en545264