O'Reilly logo

Wearable-Tech Projects with the Raspberry Pi Zero by Jon Witts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Graphing our steps

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:

mkdir ~/WearableTech/Chapter7

Then, move into that directory by typing this:

cd ~/WearableTech/Chapter7

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required