Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 2.68 KB

File metadata and controls

53 lines (37 loc) · 2.68 KB

Assignment

LED Control via Python

Write a Python script using one or more loops to produce the following effects, in order:

  1. Turn off all LEDs
  2. Delay 1 second
  3. 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).
  4. 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).
  5. 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).
  6. 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).
  7. Return to Step #1 (loop forever)

GPIO Assignments

  • 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

Lab Demonstration

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).

What to turn in

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.

Notes

Other documentation:

Next up: go to Introduction to Ansible

© 2015-18 LeanDog, Inc. and Nick Barendt