I know there are "QTouch" libraries from Atmel/Microchip for selected AVR but as far as I can see from code such as:
https://gist.github.com/luisfcor...
it should be possible to do it on the pins of any AVR. The typical operation sequence always tends to be along the lines of:
uint8_t capsensePORTD(uint8_t mask) { PORTD = 0; //Ground the PCB surface DDRD = 0xFF; asm("nop"); cli(); DDRD &= ~(mask); //Turn selected pin to input PORTD |= mask; //With pullup uint8_t cycles = 0; if (PIND & mask) { cycles = 0;} else if (PIND & mask) { cycles = 1;} else if (PIND & mask) { cycles = 2;} else if (PIND & mask) { cycles = 3;} else if (PIND & mask) { cycles = 4;} else if (PIND & mask) { cycles = 5;} else if (PIND & mask) { cycles = 6;} else if (PIND & mask) { cycles = 7;} else if (PIND & mask) { cycles = 8;} else if (PIND & mask) { cycles = 9;} else if (PIND & mask) { cycles = 10;} else if (PIND & mask) { cycles = 11;} else if (PIND & mask) { cycles = 12;} else if (PIND & mask) { cycles = 13;} else if (PIND & mask) { cycles = 14;} else if (PIND & mask) { cycles = 15;} else if (PIND & mask) { cycles = 16;} sei(); PORTD = 0; //Ground the PCB surface return cycles; //Return measured cycles }
So you drive low, then switch to pulled up input and effectively measure (with closely spaced PIN reads) when the observed bit goes high.
As far as I can tell this approach may have first started here:
https://support.bantamtools.com/...
(and the capacitive.ino there)
So is anyone doing it in this simplistic way? How successful/effective is it exactly?
I'm just wondering how feasible it would be to do something like:
I know touch keyboards can be successful because of:
which is on possibly the most successful small synth of the current era. But I'm just wondering how feasible this is as DIY ?
PS and yes, I did look at the Capacitive Touch community here but I was almost knocked down by the large tumbleweeds that went rolling past !! (anyway, that's al about the "potted" QTouch solution anyway).