O'Reilly logo

Python Programming with Raspberry Pi by Srihari Yamanoor, Sai Yamanoor

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

Building the visual aid

Let's build a visual aid where we display the number of steps taken in a given day using an LED strip. The LED strip would light up like a progress bar based on the daily physical activity.

  1. The first step is importing the requisite libraries while building the visual aid. This includes the fitbit and blinkt libraries. We will also import some additional libraries:
       import blinkt        import datetime        import fitbit        import time        import schedule
  1. Make sure that you have the requisite tokens discussed earlier in this section:
       CONSUMER_KEY = "INSERT_KEY"        CONSUMER_SECRET = "INSERT_SECRET"        ACCESS_TOKEN = "INSER_TOKEN"        REFRESH_TOKEN = "INSERT_TOKEN"
  1. A new refresh token is needed every 8 hours. This is a feature of the ...

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