Pages: [1]   Go Down
Author Topic: led brightness  (Read 323 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's something missing here:

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


Hint: you have two pins.....  smiley-cool
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 436
Posts: 23624
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

Once you fix that, the LED brightness will also vary with the current limit resistor used, and the mcd rating of the LED.
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.

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

smiley-grin:D i need a break smiley-wink

Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 436
Posts: 23624
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

Sometimes it does come down to that smiley-cool
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: