Comments (3)
Hi Ralph,
thanks for bringing this up. I never had a chance to test this on the various AtTinys, support on the tiny13 is a contribution by @UriShX I'll ask him to investigate this as I currently don't have the time or hardware required.
Martin
from adctouch.
Hi Ralph, Martin,
I have it currently working on a tiny13a in a circuit with PB2 left floating, since I also use it for SCK, and I am detecting touch on PB3. I found that as long as the power to the circuit is over 3V, detection works quite well for the purposes I used it.
I realize that the intent of line 24 is to ground the pins and discharge the s&h cap. I simply did not understand at the time the importance of that. I will investigate further, perhaps give the t13 its own definition, like:
#if defined(__ATtiny13__)
// charge s&h cap
pinMode(digitalPin, INPUT_PULLUP);
// set ADMUX
ADMUX = (ADMUX & 0xF0);
// set pin as output, then set value to high, then low. acc. to TDS section 10.2.3 Switching Between Input and Output
pinMode(digitalPin, OUTPUT);
digitalWrite(digitalPin, HIGH);
digitalWrite(digitalPin, LOW);
// set pin as input without charging s&h cap again
pinMode(digitalPin, INPUT);
#endif
Uri
from adctouch.
I did some experimentation with the technique, and got the best results by:
- ground the touch pin with ADC enabled to discharge the ~10pf S/H cap.
- disable ADC & charge touchpad
- enable ADC and take a reading after the charge is equalized
Here's the prototype code:
https://github.com/nerdralph/nerdralph/blob/master/avr/adctouch.c
Since the t13's ADMUX setttings are a subset of the tx5, it should work the same on the tiny 25/44/85.
from adctouch.
Related Issues (9)
- Error message: if (digitalPin == NOT_A_PIN) return; HOT 3
- ATTINY85 (Digispark) returns negative values. HOT 7
- consider shifts instead of division HOT 3
- atmega328P @ 8mhz and 3,3v input voltage HOT 2
- tring to jnstall in arduino not install from libray HOT 3
- Attiny 0/1 series HOT 3
- No license HOT 2
- ATSAMD51 supported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adctouch.