Git Product home page Git Product logo

adctouch's People

Contributors

derfaq avatar gculik avatar martin2250 avatar per1234 avatar urishx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adctouch's Issues

Attiny 0/1 series

Is there any chance you can support the new Attiny 0/1 series?
ADMUX is not defined (in the Arduino IDE at least).

ATTINY85 (Digispark) returns negative values.

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);
}`
```

Error message: if (digitalPin == NOT_A_PIN) return;

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).

No license

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 :)

tring to jnstall in arduino not install from libray

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

consider shifts instead of division

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.