Book Image

Arduino Wearable Projects

Book Image

Arduino Wearable Projects

Overview of this book

Table of Contents (16 chapters)

Finishing the glasses Knight Rider style


For the last code example, we will have a look at how to create an animation. An animation is a simulation of motion, and in one sense the first code example in this chapter is a form of animation. We will build on the same principle in this section. Once you get the hang of the basic concepts, you can start building your own animations, combining the knowledge from the pattern example with the knowledge in this sketch.

In my beginner Arduino classes, the Knight Rider example is a classic. This example is inspired by the 80s hit show Knight Rider with David Hasselhoff. To be more precise, the example is inspired by the robotic car featured in the show, which is called Kit. In the front of Kit there is a small LED display that shows a bouncing light effect. This is the effect we will recreate on the front of the glasses.

The code example is fairly simple and does the same thing as the test sketch, but instead of lighting up only one LED at a time we...