Adding LEDs to a code

Hi

How do you add pins to the codeing?

Take this example

int ledPin = 13;	// LED is connected to digital pin 13
int sensorPin = 0;	// light sensor is connected to analog pin 0
int sensorValue ;	// variable to store the value coming from the sensor

void setup()	 
{	 
  pinMode(ledPin, OUTPUT);	// sets the ledPin to be an output
  Serial.begin(9600);	//initialize the serial port

How do i add a second, third, fourth led?

Is this code correct?

int ledPin = 13;	// LED is connected to digital pin 13
int ledPin = 12;  //LED is connected to digital pin 12
int sensorPin = 0;	// light sensor is connected to analog pin 0
int sensorValue ;	// variable to store the value coming from the sensor

void setup()	 
{	 
  pinMode(ledPin, OUTPUT);	// sets the ledPin to be an output
  Serial.begin(9600);	//initialize the serial port

You need seperate variables and commands for each LED

eg:

int ledPin = 13;	// LED is connected to digital pin 13
int ledPin2 = 12;   //LED2 is connected to digital pin 12
int sensorPin = 0;	// light sensor is connected to analog pin 0
int sensorValue ;	// variable to store the value coming from the sensor

void setup()	 
{	 
  pinMode(ledPin, OUTPUT);	// sets the ledPin to be an output
  pinMode(ledPin2, OUTPUT);	// sets the ledPin2 to be an output
  Serial.begin(9600);	//initialize the serial port

Thanks - i couldnt figure that out

I have the leds set to flash on and off - How do i get each set of leds (they will be wired in pairs of 2) to work individually - ie sets 1, 2 and 3 will blink at a faster rate than the others?

I have this so far

int ledPin = 13;	// LED is connected to digital pin 13
int sensorPin = 0;	// light sensor is connected to analog pin 0
int sensorValue ;	// variable to store the value coming from the sensor

void setup()	 
{	 
  pinMode(ledPin, OUTPUT);	// sets the ledPin to be an output
  Serial.begin(9600);	//initialize the serial port

}	 
void loop()   {
  if ( analogRead(sensorPin) <= 100)    // read sensor
  
{

  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(1000);              // wait for a second
}
else 
{

  digitalWrite(ledPin, LOW); // turn led off

}
}

See my reply in this thread :

http://arduino.cc/forum/index.php/topic,57565.0.html

You can't have delay() in your sketch, because they stop everything happening for the set time.