What do you need
- Arduino board
- Resistors
- A red, green and blue led
- paper
- tissue paper
- colored straws
- piece of plastic scratched with sandpaper
Color mixing
Color mixing is the ability that our eyes have to combine different light colors and create a new color
A additive (light) color mixing diagram
According to this diagram, if you turn on both red and blue light mixed together you should get a violet light.
Program your chip so that you create the following colored light: Violet (red & blue), Turquoise (blue & green) and yellow (green & red)
Modify the sketch so that the emitted light goes in order: red, yellow, green, turquioise, blue violet and back to red. It should pause about half a second between each color change.
Hint: One way to make the color mixing work better is to diffuse the light, in a light box. You can make a light box out of plain paper, scissors and some tape. Just make a paper box and cut a hole in it. Fill the box with tissue paper. The tissue acts as a diffuser, helping the light mix nicely
Alternatively, place a straw over your led. Use random to create a flickering light:
int led=9;
int val=0;
int delayVal=0;
void setup(){
randomSeed(0);
pinMode(led,OUTPUT);
}
void loop(){
val=random(100,255);
analogWrite(led,val);
delayVal=random(50,150);
delay(delayVal);
}