http://www.esp8266.com/viewforum.php?f=25
Here is my progress with Ticker for now, but I haven't time to test it on ESP12 yet. Maybe tonight.
http://pastebin.com/a0cYn9fZ
Regards
Explore... Chat... Share...
Gabi Mihai wrote:Hi,
I've designed a capacitive touch on ESP-01 and I hope that you enjoy it!
Here is the LUA code:
local send_pin = 4 --GPIO2
local float_pin = 3 --GPIO0
gpio.mode(send_pin,gpio.OUTPUT)
gpio.mode(float_pin,gpio.INT)
counter = 0
comanda = 0
function print_comanda()
tmr.alarm(0, 500, 0, function()
print("comanda = ", comanda)
comanda = 0
end)
end
function incr_comanda()
tmr.alarm(1, 50, 0, function()
if counter > 3 then
comanda = comanda + 1
counter = 0
tmr.stop(1)
end
end)
end
function test()
if gpio.read(float_pin) == gpio.HIGH then
counter = counter + 1
incr_comanda()
print_comanda()
end
end
pwm.setup(send_pin, 1000, 512)
pwm.start(send_pin)
gpio.trig(float_pin,"both",test)
I put a 800kohm resistor between send_pin and foiled float_pin and it works.
Gabi Mihai wrote:Hi,
I've designed a capacitive touch on ESP-01 and I hope that you enjoy it!
Here is the LUA code:
local send_pin = 4 --GPIO2
local float_pin = 3 --GPIO0
.....
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]