The first thing we are going to do is to write a short program, which will record our change in the x axis over time and record it into a file. We can then use this data to plot a graph, so we can decide on our threshold values.
Let's begin by installing the ADXL345 Python library into our project directory. Power on your Pi Zero and connect to it again via SSH. Once you are connected to your Pi Zero, create our new project directory by typing this:
Then, move into that directory by typing this:
As we did in Chapter 4, A Motion-Reactive LED Cap, we are now going to clone the Python library for the ADXL345 by typing this:
git clone https://github.com/jonwitts/adxl345-python.git ...