Giter Site home page Giter Site logo

Comments (14)

PaulStoffregen avatar PaulStoffregen commented on July 17, 2024

I can't troubleshoot ESP8266 problems. But if someone does solve this, please submit the fix as a pull request. As long as it only changes the ESP8266-specific code, I'll be happy to merge the fix.

from capacitivesensor.

develpr avatar develpr commented on July 17, 2024

@s00500 if you don't mind me asking, how did you have your circuit setup for this? Are you using the ADC pin?

from capacitivesensor.

s00500 avatar s00500 commented on July 17, 2024

No, I havn't been using D5 and D6 (GPIO 12 and 14)

from capacitivesensor.

androcioli avatar androcioli commented on July 17, 2024

@s00500 Hi I'm getting an Exception (29) on the esp8266 too. Did you resolve this problem with CapacitiveSensor or you have found another code for the ESP8266?

from capacitivesensor.

s00500 avatar s00500 commented on July 17, 2024

@androcioli no i've been using way simpler code to do this.

from capacitivesensor.

androcioli avatar androcioli commented on July 17, 2024

@s00500 Do you can making the code available you're using?

from capacitivesensor.

BorisWild avatar BorisWild commented on July 17, 2024

Open CapacitiveSensor.h... find lines 95 - 104... and refresh them with that:
#elif defined(ARDUINO_ARCH_ESP8266)
#define PIN_TO_BASEREG(pin) ((volatile uint32_t*) GPO)
#define PIN_TO_BITMASK(pin) (1 << pin)
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) ((GPI & (mask)) ? 1 : 0) //GPIO_IN_ADDRESS
#define DIRECT_MODE_INPUT(base, mask) (GPE &= ~(mask)) //GPIO_ENABLE_W1TC_ADDRESS
#define DIRECT_MODE_OUTPUT(base, mask) (GPE |= (mask)) //GPIO_ENABLE_W1TS_ADDRESS
#define DIRECT_WRITE_LOW(base, mask) (GPOC = (mask)) //GPIO_OUT_W1TC_ADDRESS
#define DIRECT_WRITE_HIGH(base, mask) (GPOS = (mask)) //GPIO_OUT_W1TS_ADDRESS

from capacitivesensor.

PaulStoffregen avatar PaulStoffregen commented on July 17, 2024

fixed by 83ee030

from capacitivesensor.

Maxr1998 avatar Maxr1998 commented on July 17, 2024

@BorisWild @PaulStoffregen I somehow can't get this to work for me with my ESP8266-12E, it always throws a timeout (-2). This is my code:

#include <CapacitiveSensor.h>

CapacitiveSensor csense = CapacitiveSensor(12, 14);

void setup() { 
  Serial.begin(115200);
}

void loop() {
  Serial.println(csense.capacitiveSensor(30));
}

I'm using the latest library version cloned from GitHub.

I have a 10MOhm resistor wired up to pin 12, and a 1KOhm resistor to pin 14. They are soldered together on a 1cm (2.54 cm)*1cm (2.54 cm) sheet of copper tape. Do I have to search the error in the code or in the wiring?
Btw, if I short the pins with my finger, the value gets to zero, when removing the finger it jumps up to sub-100, but then immediately goes back to -2.

from capacitivesensor.

BorisWild avatar BorisWild commented on July 17, 2024

Too big resistors.

3 нояб. 2016 г. 1:22 пользователь "Max Rumpf" [email protected]
написал:

@BorisWild https://github.com/BorisWild I somehow can't get it to work
for me, it always throws a timeout (-2). This is my code:

#include <CapacitiveSensor.h>

CapacitiveSensor csense = CapacitiveSensor(12, 14);

void setup() {
Serial.begin(115200);
}

void loop() {
Serial.println(csense.capacitiveSensor(30));
}

I have a 10MOhm resistor wired up to pin 12, and a 1KOhm resistor to pin
14. They are soldered together on a 1cm*3cm sheet of copper tape. Do I have
to search the error in the code or in the wiring?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQkLDGOKaSZuJ4CrgVDDottQR6qqqpliks5q6Q0WgaJpZM4GIycg
.

from capacitivesensor.

Maxr1998 avatar Maxr1998 commented on July 17, 2024

@BorisWild Well, example code said:

Uses a high value resistor e.g. 10M between send pin and receive pin
Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
Receive pin is the sensor pin - try different amounts of foil/metal on this pin

What values would you recommend for the ESP then?
I want it to sense through a 2mm sheet of plastic, that's why I ask.
Thanks for your help! :)

from capacitivesensor.

Maxr1998 avatar Maxr1998 commented on July 17, 2024

Ok, I tested my resistor values on an Arduino Mega, where they work fine.
Now I just need to adapt them to my ESP8266.

from capacitivesensor.

rmeister avatar rmeister commented on July 17, 2024

Came here for the same problem as Maxr1998, but found out that in my case reason for the error was different: The library does not support GPIO16 on the ESP8266.

I use a 10K resistor for direct touch sensing.

from capacitivesensor.

Maxr1998 avatar Maxr1998 commented on July 17, 2024

Forgot to update, it also works for me now, with a 100k to 200k resistor through a 1mm layer of plastic.

from capacitivesensor.

Related Issues (20)

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.