Code Monkey home page Code Monkey logo

Comments (3)

martin2250 avatar martin2250 commented on August 18, 2024

Hi Simone,
I currently don't have time to work on adding support for new chips. That said, if you (or someone else) want to work on it, I'd be happy to accept pull requests 😉
Cheers

from adctouch.

agrimagsrl avatar agrimagsrl commented on August 18, 2024

I wish I could understand half the code you wrote... I know nothing about registers.
I found a different approach that works for my use-case. I will report here just in case someone else needs it.
It's dirty naive, but I only need to get a rough idea of how much a touch sensor was "touched".

uint16_t read(uint8_t pin) {
        // write HIGH to pin, then LOW, then read its voltage
        pinMode(pin, OUTPUT);
        digitalWrite(pin, HIGH);
        delay(50);
        digitalWrite(pin, LOW);
        pinMode(pin, INPUT);
      
        uint16_t readings[numReadings];
        uint16_t sum = 0;
      
        for (int i = 0; i < numReadings; i++)
          readings[i] = analogRead(pin);
      
        for (int i = 0; i < numReadings; i++)
          sum += readings[i];
          
        return sum / numReadings;
    }

from adctouch.

hghile avatar hghile commented on August 18, 2024

Seems like this should do it?
https://github.com/SpenceKonde/ADCTouch/tree/master/src

from adctouch.

Related Issues (9)

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.