martin2250 / adctouch Goto Github PK
View Code? Open in Web Editor NEWtouch sensing library for Arduino
License: MIT License
touch sensing library for Arduino
License: MIT License
Division on AVRs is very expensive in both time and space. Signed long division will increase code size by about 150 bytes.
Even better would be to do the averaging by summation only. Do a fixed 64 loops, adding the ADC value to a uint16_t. Since the AVR ADC is 10 bits, 64 loops will give a final result that fits in 16 bits without overflow.
Is there any chance you can support the new Attiny 0/1 series?
ADMUX is not defined (in the Arduino IDE at least).
This libraryworks flawlessly and ways better than every other soloution I tried :)
However a missing license technically permits nobody to use, modify and distribute this masterpiece which is sad :(
If you don't want to restrict any use of this software and therefore added no license you could add something like Unlicense to make your intentions clear :)
Hi I am trying to use your ADCTouch library and it works on my arduino, but i can't seem to upload it to my ATtiny85 microchip. I get the following error message:
C:\Program Files (x86)\Arduino\Arduino Projekt\libraries\ADCTouch-master\src\ADCTouch.cpp:13:31: error: return-statement with no value, in function returning 'int' [-fpermissive]
if (digitalPin == NOT_A_PIN) return;
^
exit status 1
Error compiling for board ATtiny85 @ 8 MHz (internal oscillator; BOD disabled).
not installing from arduino labray list dose tell its is install keep get erorr C:\Users\ken58\OneDrive\Documents\Arduino\libraries\ADCTouch: loading library.properties: Error reading file: Error parsing data at line 0: Invalid line
not showing it is install in libary
Right now the ADCTouch.read() seems to be returning negative results when running on a 16 or 16.5mhz ATTINY85. The sensitivity of the same conductive pad is really low compared to the same pad and code run on an ATMEL MEGA32U4. (Pro Micro) setup. I get values of 0 to -36 on the ATTINY85. The same setup gets a range of 0 to around 500.
I realize this might be a limitation of the ATTINY85. Although getting negative values seems odd.
The code I used for the digispark setup is below. I used an exact copy for the Pro Micro setup, except I replaced the DigiKeyboard references with serial print and the proper analog pin reference on the Pro Micro.
Any help would be much appreciated!
#include <ADCTouch.h>
#include "DigiKeyboard.h"
int ref0; //reference values to remove offset
void setup()
{
// No pins to setup, pins can still be used regularly, although it will affect readings
ref0 = ADCTouch.read(0,500); //account for the capacitance of the pad
}
void loop()
{
int value0 = ADCTouch.read(0); // default --> 100 samples
//byte aptdp = analog_pin_to_digital_pin;
value0 -= ref0; //remove offset
DigiKeyboard.print(value0 > 40); //send (boolean) pressed or not pressed
DigiKeyboard.print("\t"); //use if(value > threshold) to get the state of a button
DigiKeyboard.print(value0); //send actual reading
DigiKeyboard.println("\t");
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(0);
}`
```
This isn't really an issue but a question. Is it possible to use this library on a stand alone atmega328p running on 8mhz and 3,3v?
Can this work with the ATSAMD51 chips?
Vor are ther alternative libs for this?
I landed her from a search and this question:
https://arduino.stackexchange.com/questions/43663/built-in-capacitive-touch-detection-with-samd21-development-board-arduino-zero#43694
The tiny13 only has 2 mux bits, not 4. I'm guessing the code has not been tested on the t13. as it won't work unless ADC1 (PB2) happens to be grounded.
https://github.com/martin2250/ADCTouch/blob/master/src/ADCTouch.cpp#L24
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.