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.
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.
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.
The following elements are used in this sample: