This project uses the MPU6050 motion sensor, Mini OLED SSD1306, and Arduino MKR1010 to render 3D objects on the OLED display and rotate them using real-time motion from the MPU6050.
The code can be easily converted for any microcontroller (ESP32, ESP8266, Arduino Nano, UNO, etc.) using ChatGPT.
π Features
β Real-time 3D motion rendering β MPU6050 gyro + accelerometer tracking β Works with MKR1010 (default) β Portable code, easy to adapt to other boards β Only 3 libraries required
π¦ Step 1: Install Required Libraries
#include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <MPU6050.h> You can install them from:
Arduino IDE β Tools β Manage Libraries β Search β Install
π§© Step 2: Install MKR1010 Board Package
Open Arduino IDE
Go to Tools β Board β Boards Manager
Search: βArduino SAMD Boards (32-bit ARM Cortex-M0+)β
Install it (This adds support for MKR1010)
π Step 3: Make the Connections
Open the connections folder and follow the wiring diagram. Typical connections: MPU6050 β MKR1010 SDA β SDA SCL β SCL VCC β 3.3V GND β GND
SSD1306 OLED β MKR1010 SDA β SDA SCL β SCL VCC β 3.3V GND β GND
π» Step 4: Upload Code Open the code folder In Arduino IDE set: Tools β Board β Arduino MKR WiFi 1010 Select Port Click Upload Once uploaded, the OLED will display a 3D shape rotating according to MPU6050 movement.
**Using Other Microcontrollers? ** This project works with many boards: ESP32 ESP8266 Arduino Nano Arduino UNO AVR / ARM boards You can ask ChatGPT to automatically convert the code for your board.