Sep 20
homework
You have a "first two labs" assignment due today,
with some circuit questions.
google "sparkfun led" , and let's discuss.
Today in the lab : Lab 3, RGB LED.
the circuit
First let's build it, and understand why it is what it is.
the code
The program that runs it is much more elaborate than
the earlier ones. Here are the new concepts :
- functions - encapsulate a recipe to do something
- "for" loop - do something over and over, incrementing a variable
- "if" conditionals - only do something if a condition is true
color
Discuss red/green/blue color model,
why 0-255 is the range for each,
and what colors match which numbers.
variations
Other sequences of colors :
- intensities of red only
- intensities of grey only (red=black=white)
- any curve in the RGB color cube ...
- "circle" of any two shades ...
Manual color selection with potentiometers :
with 3 of 'em (put together 3 kits),
you can control red, one green, one blue.
Like what we did with blink speed, but this
time with color choice.