This little project combines the previous accelerometer-gyroscope code with the 3D rotating OLED cube to produce a 3D cube which responds to gyro input, making it possible to “peek around” the cube with simulated perspective, or make it spin with a flick of the wrist.

Libraries
We need two Python drivers for this project — one for the 128x64 OLED display, and one for the gyroscope.

The display in this example uses the ssd1306 chip, so we can use the module available in the MicroPython repository.

The gyroscope is a MPU6050, a Python library for which is available from @adamjezek98 here on Github.

Download both files and upload them to your controller using ampy or the web REPL.

Once the libraries are in place, connect to your controller and try and import both packages. If the imports work, you should be good to go.”

Link

Related Content