In this recipe, we will create a loop that continually reads from the accelerometer and prints the x, y, and z axes' data. Printing output will help us experiment with how the sensor will react to shaking the board or tilting it in different directions. Once you get a sense of how the sensor works, you can start incorporating it into projects to have your board react to tilt or acceleration.
Reading data from the motion sensor
Getting ready
You will need access to the REPL on Circuit Playground Express to run the code presented in this recipe.
How to do it...
Follow...