Accelerometer visualization 2

Setting up the OLED

As a test, I altered the ‘falling stars’ code from the Adafruit Library…to make hearts!

Had to change the 8-bit address in the header file (from `0x3C` to `0x3D`), as well as specifying in setup:

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.ssd1306_command(0x3D);
display.ssd1306_command(0x14);


Adding the Accelerometer

This part was very tricky! I went back and forth between trying new libraries and combining the existing Arduino code from the first visualization with the OLED. But I ran into a lot of guessing games with respect to the 8-bit address for both the OLED and the MPU6050 – all while keeping track of what was being declared where.

I ended up using the code from this demo: which is really close to what I had in mind! Crazy luck with this… he/she had the EXACT same two parts I have!
All that was left was to print the z-axis along with the rest of the values.

Leave a Reply

Your email address will not be published. Required fields are marked *