Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 1.62 KB

README.md

File metadata and controls

30 lines (18 loc) · 1.62 KB

More blinking lights, with hardware controls

This sample demonstrates blinking multiple LED on different schedules and controlling the LEDs from hardware controls. The sample builds on the Blink an LED and Mcp3008 samples.

Code

This sample demonstrates how to use five different elements together, three LEDs, a potentiometer and a button. There is no one specific code element to call out here. Each element is controlled in a different way. You will find that different algorithms were needed to control LED timing than in the Blink an LED example. In particular, this sample implements the following:

  • Different lighting schedules for different LEDs using the TimeEnvelope type.
  • Integrating a factor in the lighting schedule based on the value returned from the potentiometer, implemented in the Volume type.

Breadboard layout

The following fritzing diagram demonstrates how you should wire your device in order to run the program. It uses several pins on the Raspberry Pi.

Raspberry Pi Breadboard diagram

Hardware elements

The following elements are used in this sample:

Resources