Software - Inputs and Outputs

Hardware Testing and Library Installation 

Software Walkthrough
Follow along to test the hardware modules

The IMU Game uses a few pieces of hardware beyond just the Arduino. We have a vibration motor, the microswitch, an OLED screen, and the IMU itself. This section will test a few of these components.

OLED Check

The OLED Screen must be wired to the Arduino. Follow the wiring diagram and table. Your wire colors might be different than the guide.

OLED Pins Arduino Pins
CLK Pin 13
MOSI Pin 11
RES Pin 12
DC Pin 9
CS Pin 10

The OLED screen needs a library installed. It is called U8glib and is used when using monochromatic displays. To install it open up the Arduino IDE then by using the bar at the top go to Sketch > Include Library > Manage Libraries. In the search bar, type in U8glib. As of writing this, I get the following 3 results; LCDMenu, U8g2, and U8glib. We want the last one so press install.

With that library installed download this sketch and upload to your Arduino with OLED attached. You should see a rectangle that grows and shrinks on the screen continuously. If it does not appear, use the comments within the code to check your wiring.

Navigating to Manager
Navigating to Manager
Installing Library


The IMU needs two libraries. One for the protocol the sensor uses and another for the actual sensor itself. Both however cannot be found in the Arduino IDE Library Manager so installing them are a bit different.

Download these two zip folders.

I2Cdev Library

MPU6050 Library

To add these libraries to the Arduino IDE we'll again go to the top bar and go to Sketch > Include Library > Add .ZIP Library. Navigate to where you have the folders downloaded and add them one at a time.

Next we'll check if the gyroscope is working properly. Download this sketch and upload to your Arduino with IMU attached. Open the Serial Monitor under Tools > Serial Monitor in the Arduino software. You should see two numbers, one for yaw and one for pitch. These numbers should correspond to the gyroscope's orientation, so try rotating it left and right (yaw) and up and down (pitch) and see if the numbers change accordingly. If they do change, but somewhat erratically, try pressing the button on the IMU Game PCB and keep the accelerometer level until it completes calibration.

Ready to go 

After these tests the hardware is ready to go. Download the full game code here and upload it to IMU game kit.

All done!