This recipe will show you how to create a function that detects when the board is flipped over. To achieve this, we will use the orientation data that we fetched from the accelerometer. We will focus on the z axis data as this will indicate whether the board is facing up or facing down. The approach presented in this recipe can be useful to you whenever you are creating a project and want to find a more creative way of interacting with the project than just pushing buttons. This can create a fun level of interaction when someone discovers that all they have to do is flip over your board to interact with it.
Detecting board-flipping with the accelerometer
Getting ready
You will need access to the REPL on the Adafruit HalloWing...