Go Down

Topic: led brightness (Read 410 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)
Roy from ITCrowd: Have you tried turning it off an on again?
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

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. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

ecokarl


CrossRoads

Sometimes it does come down to that 8)
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.

Go Up