Comments (14)
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.
@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.
No, I havn't been using D5 and D6 (GPIO 12 and 14)
from capacitivesensor.
@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.
@androcioli no i've been using way simpler code to do this.
from capacitivesensor.
@s00500 Do you can making the code available you're using?
from capacitivesensor.
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.
fixed by 83ee030
from capacitivesensor.
@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.
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.
@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.
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.
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.
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)
- compile error with RF-Duino HOT 1
- Wemos D1 mini (esp-8266) - Error -2 HOT 5
- Analog pin affecting capacitive sensor values HOT 4
- Library and T=RC formula HOT 1
- Error -2 when using the ESP8266 HOT 4
- Always timeout (-2) with Wemos D1 Mini and 1MOhm resistor HOT 2
- Licence update
- could i use it on esp-idf ?
- does it support ESP32 board ? HOT 16
- CapacitiveSensor + interrupt HOT 1
- Compatible device
- Need help with understanding the CapacitiveSensor circuit diagram HOT 2
- Does this work wiith Adafruit Feather nRF52840 express ?
- Hi Paul do you have any plans to add in the Metro M4 (samd51) HOT 1
- Arduino Nano 33 BLE compatibility HOT 7
- too big capacity
- Compilation of example sketch fails with esp8266 board package version >= 3.0.0 HOT 1
- Arduino Nano RP2040 Connect compatibility HOT 4
- Update the version and create a new release HOT 2
- Build error on Aduino GIGA STM32 HOT 2
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 capacitivesensor.