IMPORT: Using GROVE kit sensor kit, so no digital or analogue port specifications.
Interactive spaceship using accelerometer and OLED screen
By moving the accelerometer, it ahould move the spaceship forward, backwards, to the left, or right depending on the direction of your tilt. In fact, we can do that because this device measures the acceleration in directions x, y and z. The acceleration on a flat surface would then be 0 for y and x, but 9.81m/s^2 in the z direction because of gravity, so depending on how you tilt the screen, the gravitational force will impact each direction specificaly.
