Pages: [1]   Go Down
Author Topic: Super Noob - 7-Color LED  (Read 2488 times)
0 Members and 1 Guest are viewing this topic.
Ca
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just got my Arduino Uno.  I ran to Radio Shack and bought some LEDs.  One of the LED's  I bought is a 7-Color Blinking LED(Radio Shack Part # 276-0016). 

I started looking on Google and I found this video explaining how the LED works. 

Here is the code  that I started trying to get it to cycle through the 7 colors.  I can not figure out how to link the Control pin to the Ground. 

I might not even be on the right track but I thought I would ask.  Thanks for the help.


Code:
int neg =  13;    // +LED connected to digital pin 13
int pos =  12;    // -LED connected to digital pin 12
int crtl =  11;  // control coonected to digital pin 11

// The setup() method runs once, when the sketch starts

void setup()   {               
  // initialize the digital pin as an output:
  pinMode(neg, OUTPUT);
  pinMode(pos, OUTPUT);
  pinMode(crtl, OUTPUT);
  digitalWrite(pos, HIGH);    // set the LED on
  digitalWrite(neg, LOW);   // set the LED off
  digitalWrite(crtl,LOW);  //ser the crtl off
  delay(15000);                  // wait for 15 second
}
// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()                     
{
 digitalWrite(crtl, HIGH);
 delay(250);
 digitalWrite(crtl, LOW);
 delay(250);
 
 

}

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unfortunate that there is no specification on the radio shack website for this and my connection to youtube is acting up ..

Is there a little black dot inside the LED. If so this is probably a built in silicon chip that does the color/cycle choosing for you so you are right about the control pin that needs to be toggled.

Try connecting the postive to the pin (as you have it) and the negative to ground (via a resistor!)
Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 25
Posts: 1133
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The microprocessor chip is NOT a powersupply !!  Stop using the pins to supply the power (the + and -) this may damage your chip.  The Arduino board has a GND and a 5V pin - these come from the USB-power (or the external power adjusted to 5v by the onboard regulator) so they can give you enough power without risk.

Your code is correct - except you ONLY need to use the "Ctrl pin" related code.

Why do you ask about "link the Control pin to the Ground"? Doing the HIGH LOW toggle effectivly grounds the ctrl signal to ground.

Lastly, the LED may burn out when getting 5V. Put a resistor between 2000 and 300 ohm between the 5V and the +LED. I found some tiny bit of documentation
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23660
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's the datasheet
http://www.dz863.com/downloadpdf-cfloxgvdkiju-MSGBB557TA.pdf

I like the link you found that discusses the modes that seem possible.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: