Write a Python script using one or more loops to produce the following effects, in order:
- Turn off all LEDs
- Delay 1 second
- Over a period of 1 second, smoothly ramp the Red light from 0% to 100% intensity, and then back to 0% (i.e., half second ramp up, half second ramp down).
- Over a period of 1 second, smoothly ramp the Green light from 0% to 100% intensity, and then back to 0% (i.e., half second ramp up, half second ramp down).
- Over a period of 1 second, smoothly ramp the Blue light from 0% to 100% intensity, and then back to 0% (i.e., half second ramp up, half second ramp down).
- Over a period of 1 second, smoothly ramp White light from 0% to 100% intensity, and then back to 0% (i.e., half second ramp up, half second ramp down).
- Return to Step #1 (loop forever)
- The Blue light color channel is controlled by GPIO13
- The Red light color channel is controlled by GPIO19
- The Green light color channel is controlled by GPIO26
Please be prepared to demo your system at the very start of the next class (you might want to arrive a few minutes early to make sure your system boots up and is working properly).
Before the start of class next week, one member of each pair should send an email to the instructor with the following:
- Subject: Assignment 1
- Names of the members of pair
- A short (a few sentences) write up from each member of the pair summarizing what they learned completing the assignment, and one thing that surprised them (good, bad, or just surprising).
- How many hours total you and your partner spent on this week's assignment, rounded to the nearest hour.
- Attach the file containing the required Python script
- Attach a short (5-10 second) video demonstrating the required lamp behaviors.
- The following pigpio functions might be useful:
- The following Python time function might be useful:
- The Python range() built-in function might be useful.
- Please have everything you need setup and ready to demonstrate before class starts
Other documentation:
Next up: go to Introduction to Ansible
© 2015-18 LeanDog, Inc. and Nick Barendt