0001 0101 0000 0000 0001 0001 0000 0000 0010 0110
I'm not far enough along yet to know how that should be read into the variables.
Explore... Chat... Share...
sancho wrote:cdrwolfe wrote:I'm beginning to wonder if this is possible at all using lua.
For the life of me I can't get the chip to correctly control the gpio pins. With the DHT22 connected it is always set as high, calling gpio.write(pin, gpio.LOW) does nothing .
If anyone else has any luck feel free to post it .
Regards
Cdr
Which version of ESP do you have? The very first ESP-01 did not have GPIO pins connected to the output pins of the board - therefore doing anything with the code would result in absolutely nothing.
-- Step 2 - Read data stream
-- Data recieved as 40 bits of data, 16 bits for humidity, 16 bits for temperature and 6 bits checksum
-- Need to convert from binary to decimal and divide by 10
-- When highest bit of temperature is '1' it means that temperature is below '0'
for i = 0, 5, 1 do
for j = 0, 8, 1 do
-- Reset count
retryCount = 0;
-- Wait for DHT22 pin to pull low
while gpio.read(pin) == 0 do
-- Check retry count
if retryCount > 75 then
print "DHT22 timeout waiting for data"
end
-- Increment count
retryCount = retryCount + 1
-- Wait 1us
tmr.delay(1)
end
-- Once confirmed wait a specified time '40us+'
tmr.delay(40)
-- Check data bit value
if (gpio.read(pin) == 1) then
-- DHT22 pin is high, bit value is a 1
bitData[i*8+j] = 1
else
-- DHT22 pin is low, bit value is a 0
bitData[i*8+j] = 0
end
-- Wait for 1us and pin is high
count = 0
-- Loop
while gpio.read(pin) == 1 and count < 100 do
tmr.delay(1)
-- Increment
count = count + 1
end
end
end
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[…]