RGB Flashlight, wearable sound art, rainbow lamp.
/* LucidTronix Arduino HSB RGB Color library * http://www.lucidtronix.com/tutorials/19 * Control rgb color by specifying * Hue saturation and brightness. * This code shows a rainbow */#include// these are the pins connected to// the RGB LEDs. They must be PWM capableint leds[] = {5,6,9}; Color cur_color = Color(1,1,1);float hue = 0;void setup() // run once, when the sketch starts { for(int i = 0 ; i < 3; i++ ){ pinMode(leds[i], OUTPUT); }}void loop() // run over and over again { display_color(cur_color); rainbow();}void rainbow(){ hue += 0.06; if ( hue >=1 ) hue = 0; float sat = 1.0; float val = 0.4; cur_color.convert_hcl_to_rgb(hue,sat,val); display_color(cur_color); delay(20);}void display_color(Color c){ analogWrite(leds[0], c.red); analogWrite(leds[1], c.green); analogWrite(leds[2], c.blue); delay(100);}
| Title | Description | # | Cost | Link | Picture |
| RGB SunLight PCB | Printed Circuit Board (PCB) for the RGB SunLight. Has proven through-hole footprints and eletrically tested traces. | 1 | $15.0 | Link |
|
| ATMEGA168A-PU | IC MCU AVR 16K FLASH 28PDIPValue: 16KB (8K x 16) 1.8 V ~ 5.5 V | 1 | $2.54 | Link |
|
| Battery Holder | Holds 3 AAA Batteries. Has on/off switch.Value:4.6V | 1 | $1.95 | Link |
|
| RGB LED | Clear Common CathodeValue:(800, 4000, 900)mcd | 5 | $1.95 | Link |
|
| Electret Condenser Microphone | MIC COND ANALOG OMNI -44DBValue: -44dB ±2dB 20Hz ~ 20kHz | 1 | $0.96 | Link |
|
| LM386 | IC AMP AUDIO PWR .325W MONO 8DIPValue:4 V ~ 12 V | 1 | $0.93 | Link |
|
| Photocell | Photo resistor Light sensor 16-33KOHMValue: 16 ~ 33 kOhms @ 10 lux | 1 | $0.8 | Link |
|
| Potentiometer | POT ROTARY, Linear 10K OHM 9MM SNAPINValue:10k | 1 | $0.76 | Link |
|
| USB TYPE B R/A BLACK | USB connector type B Right/Angle black inside. | 1 | $0.54 | Link |
|
| Capacitor | Ceramic Capacitors CAP CER 0.1UF 50V 20% RADIALValue: 0.1µF | 2 | $0.24 | Link |
|
| Transistors (BJT) - Single | IC TRANS NPN SS GP 200MA TO-92Value:40V 300mV @ 5mA, 50mA 100 @ 10mA, 1V | 3 | $0.18 | Link |
|
| Button 6mm Through Hole | Tactile Switch Through Hole SPST-NO 0.05A 12VValue:0.05A @ 12VDC | 2 | $0.1 | Link |
|
| Resistor | RES 300 OHM 1/4W 5% CARBON FILMValue:300 | 15 | $0.08 | Link |
|
| Resistor | RES 10K OHM 1/4W 5% CF MINIValue:10k | 5 | $0.08 | Link |
|
| Resistor | RES 10 OHM 1/4W 5% CARBON FILMValue:10 | 3 | $0.08 | Link |
|
Comments: