Go Down

Topic: led brightness (Read 432 times) previous topic - next topic

ecokarl

Hello,

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
int led1 = 12;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(led1, HIGH);
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);
digitalWrite(led1, LOW);  // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}


this is the normal blink sketch with one led more.
there is in normal blue led connectet from pin 12 to gnd.

When i first put led13 high in the code the blue led is not so bright like when i fist put led12 high.
What is the problem? Why will the LED on pin 12 not have the same brightness?

JimboZA

There's something missing here:

Code: [Select]
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT); 


Hint: you have two pins.....  8)
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

CrossRoads

Once you fix that, the LED brightness will also vary with the current limit resistor used, and the mcd rating of the LED.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


CrossRoads

Sometimes it does come down to that 8)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up