In this recipe, we will learn how to poll the shake method and print it whenever the board has been shaken. Creating projects that can respond to the device being shaken can be really fun. The board can also be configured so that you can specify whether a light or heavy shake is required before it registers as a shake. This can open up new and creative ways to make people interact with your devices.
Detecting a shake
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 these steps...