after setting gpio.mode(9,gpio.OUTPUT) and gpio.write(9,gpio.HIGH). A gpio.read(9) sets the gpio output to 0. Can anyone configm this:
> gpio.mode(9,gpio.OUTPUT)
> gpio.write(9,gpio.HIGH)
> print (gpio.read(9))
0
regards
Explore... Chat... Share...
scoace wrote:Hi
after setting gpio.mode(9,gpio.OUTPUT) and gpio.write(9,gpio.HIGH). A gpio.read(9) sets the gpio output to 0. Can anyone configm this:
> gpio.mode(9,gpio.OUTPUT)
> gpio.write(9,gpio.HIGH)
> print (gpio.read(9))
0
regards
zeroday wrote:scoace wrote:Hi
after setting gpio.mode(9,gpio.OUTPUT) and gpio.write(9,gpio.HIGH). A gpio.read(9) sets the gpio output to 0. Can anyone configm this:
> gpio.mode(9,gpio.OUTPUT)
> gpio.write(9,gpio.HIGH)
> print (gpio.read(9))
0
regards
gpio.read() api put the pin into input mode.
gpio.mode() api now has a third para pullup, to set internal pullup of the pin.
gpio.mode(9,gpio.OUTPUT, 1 ) will enable internal pullup r.
default: pullup disabled( float)
s=net.createServer(net.TCP)
s:listen(80,function(c)
c:on("receive",function(c,pl)
for v,i in pairs {8,9} do
gpio.mode(i,gpio.OUTPUT,1)
c:send("\ngpio("..i.."):"..gpio.read(i))
if string.find(pl,"gpio"..i.."=0") then gpio.write(i,0) end
if string.find(pl,"gpio"..i.."=1") then gpio.write(i,1) end
c:send("\nnew_gpio("..i.."):"..gpio.read(i))
end
c:send("\nTMR:"..tmr.now().." MEM:"..node.heap().."\n")
c:on("sent",function(c) c:close() end)
end)
end)
>> c:on("sent",function(c) c:close() end)
>> end)
>> end)
> H????19@H?DHJ??@H?
NodeMcu 0.9.2 build 20141209 powered by Lua 5.1.4
lua: cannot open init.lua
>
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[…]