Measure angles using mpu6050 on Lolin (Wemos) D1 mini, esp8266
Measure angles using mpu6050 on Lolin (Wemos) D1 mini, esp8266
While there are many resources available on the internet for Arduino Uno development boards, I couldn’t find any instructions for Wemos D1 mini. I myself struggled to get wemos d1 mini working with MPU6050, so I’m sure this tutorial will be helpful for some folks.
Connection is very straightforward:
Wemos D1 mini | MPU6050 |
---|---|
3.3V | VCC |
GND | GND |
D3 (pin 0) | SDA |
D4 (pin 2) | SCL |
Like here:
Make sure to explicitly specify pins 0 (D3) and 2 (D4) to be used for I2C communication inside the code.
Wire.begin(0,2)
Overview of the code:
Setup function
Loop function
Full tutorial may be found here