Monday, November 30, 2015

Wiring the RGB Bulb

For this post, we had to do something completely different compared to the last post "Writing Your Name". Our objective was to make different colors by using red, blue, and green wires that would change the color of the RGB bulb. To begin, we gathered all our materials. We used the Arduino Board, 3 different colored wires, 3 receptors, bread board and the RGB bulb. The RGB blub was completely different compared to the LED light.It had the ability to light up a certain color depending on what wire was plugged in. We then being mixing the colors. When we mix, blue and red, the RGB bulb turned purple. When the green and blue were mixed, it was more of a bluish color. When we finally mixed all 3 colors, it was a purple bluish color. 


This is the code used below: int redpin=9;      //Pin 9


int greenpin=10;    //Pin 10
int bluepin=11;      //Pin 11
int var=0;
int var1=0;

void setup()
{
}

void loop()
{
  
   analogWrite(redpin,0);    //GREEN
   analogWrite(greenpin,255);
   delay(5000);


   analogWrite(greenpin,0);    //GREEN
   analogWrite(bluepin,255);
   delay(5000);
 analogWrite(bluepin,0);    //GREEN
   analogWrite(redpin,255);
   del

No comments:

Post a Comment