Flower

I created this flower lamp using a box, tissue paper and the arduino

My cousin just had a baby and it gave me the idea of making something soft and colorful.

I used the RGB Led of the Arduino kit to make the lamp loop through colors using this code :

int red_light_pin= 11;
int green_light_pin = 10;
int blue_light_pin = 9;
void setup() {
  pinMode(red_light_pin, OUTPUT);
  pinMode(green_light_pin, OUTPUT);
  pinMode(blue_light_pin, OUTPUT);
}
void loop() {
  RGB_color(255, 0, 0); // Red
  delay(3000);
  RGB_color(0, 255, 0); // Green
  delay(3000);
  RGB_color(0, 0, 255); // Blue
  delay(3000);
  RGB_color(255, 255, 125); // Raspberry
  delay(3000);
  RGB_color(0, 255, 255); // Cyan
  delay(3000);
  RGB_color(255, 0, 255); // Magenta
  delay(3000);
  RGB_color(255, 255, 0); // Yellow
  delay(3000);
  RGB_color(255, 255, 255); // White
  delay(3000);
}
void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
 {
  analogWrite(red_light_pin, red_light_value);
  analogWrite(green_light_pin, green_light_value);
  analogWrite(blue_light_pin, blue_light_value);
 }

I am very happy with the result I am sure my little cousin would love it 🙂

Liked Liked
No Comments