Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By juanpintom
#21618 Hi all!, I trying to make it working a capacitive touch button to replace/add it on my wall light switches, I maded this with an Arduino and Capsense Library, but I think I found a simple sketch to make it working. The problem it's a LUA based sketch :( and my knowledge about LUA its very limited. Here is the post (Ty to Gabi Mihai):
http://www.esp8266.com/viewtopic.php?f=11&t=3720&p=21617#p21617

Here is the actual (no tested) sketch using Ticker. I need to do more tests (soon)
http://pastebin.com/a0cYn9fZ

Any help is appreciated ;)

Regards
User avatar
By juanpintom
#22268 Finally I've done this with this simple code, simple touch, long touch (with repeat option)
http://pastebin.com/6basHByU

It have a delay of 50ms but can be changed to a ticker timer, I don't care about why on the next example the Souliss library takes control of timming and call the Function every 50ms without delays.

Here is the Souliss Example, with this we've Capacitive buttons on Souliss!! :P

https://github.com/juanpintom/Souliss_ESP_Examples/blob/master/E08_ESP_Capacitive_Sensor

Regards!
User avatar
By tytower
#22877 I've opened a couple of issues on your git hub page but you have not responded to either yet.
I asked about GPIO0 and GPIO2 and maybe a typo and also what are you doing with pin 15 and how are you doing it ?
As I said there have you actually got this code up and running yet or is it just a development .
Thanks for the code btw.
User avatar
By juanpintom
#22920 Hi tytower! Sorry, I forget to enable notifications on Github :S

I just connect GPIO0 to GND when Im uploading an sketch from Arduino IDE, before it's loaded I left free.
GPIO15 must be PullDown on the start,then you can use to other purposes, I connected GPIO15 to a TIP122 to control a Led Strip. Take care I use an Adapter with an ESP12 that have a Pulldown resistor on GPIO15.

About the capacitive code IM working on it, I get it working but I need to avoid some bad readings (sometimes reads < thresold when foil is touched) I think is caused by the timming with no delays related with Souliss. The code from Pastebin works well.

I come to github now... again sorry by the late response.

Regards.
Last edited by juanpintom on Fri Jul 10, 2015 2:21 pm, edited 1 time in total.