I've heard that the MPU6050 have also a temperature sensor, is it right?
I've heard that the MPU6050 have also a temperature sensor, is it right?
Explore... Chat... Share...
id=0
sda=5 -- D5
scl=6 -- D6
mpu6050_addr=104
i2c.setup(id,sda,scl,i2c.SLOW)
function read_reg(dev_addr, reg_addr)
-- WRITING
i2c.start(id)
i2c.address(id, dev_addr, i2c.TRANSMITTER)
i2c.write(id, reg_addr) -- writing reg_addr in dev_addr
i2c.stop(id)
-- READING
i2c.start(id)
i2c.address(id, dev_addr, i2c.RECEIVER)
c=i2c.read(id, 1) -- reading dev_addr
i2c.stop(id)
return c
end
x=string.byte(read_reg(mpu6050_addr, 65))
y=string.byte(read_reg(mpu6050_addr, 66))
sleep_reg=string.byte(read_reg(mpu6050_addr, 107)) -- 64 = 1000000
print(x.." Temperature: " .. bit.bor(bit.lshift(tonumber(x), 8), tonumber(y))) --bit.bor(bit.lshift(tonumber(x), 8), tonumber(y))
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[…]