yes i have that one working 
and i also replicated the circuit and added only 3 leds and 3ldrs just to test before adding more.
Ok at the moment I have 2 leds on 9-6 and 2 ldrs on analog pins 0-1
The problem I am finding is :
The first ldr on analog0 it stops working, once I add a second ldr and a second led.
when I put the second ldr on on analog1 the leds only go on when I cover the 2nd ldr. Nothing happens when cover the 1st ldr on analog0.
Also I don't want all leds to go on. I want each ldr to control a led. At the moment it seems that each ldr controls all leds. If ofcourse all ldrs are working. Like I said above. The first ldr was fine but when I added the second one then the 1st stoped working.
Below is how I have the code running.
Thanks !!!
/* Photocell sketch that lights up 6 leds when blocking the light */
int photocellPin0 = 0; // the cell and 10K pulldown are connected to a0
int photocellReading0; // the analog reading from the sensor divider
int photocellPin1 = 1; // the cell and 10K pulldown are connected to a0
int photocellReading1; // the analog reading from the sensor divider
int photocellPin2 = 2; // the cell and 10K pulldown are connected to a0
int photocellReading2; // the analog reading from the sensor divider
// More POWAH, more leds!
int ledPins[] = {3, 5, 6, 9, 10, 11};
int LEDbrightness;
void setup(void) {
// We'll send debugging information via the Serial monitor
// Serial.begin(9600);
}
void loop(void) {
// Read analog pin
photocellReading0 = analogRead(photocellPin0);
photocellReading1 = analogRead(photocellPin1);
photocellReading2 = analogRead(photocellPin2);
// Debugging only
// Serial.print("Analog reading = ");
// LED gets brighter the darker it is at the sensor
photocellReading0 = 1023 - photocellReading0;
photocellReading1 = 1023 - photocellReading1;
photocellReading2 = 1023 - photocellReading2;
// Debugging only
//Serial.println(photocellReading);
//Ledpin9-analog0
// If statement to turn of all the leds when below a "normal" reading
if (photocellReading0 < 850)
{
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
analogWrite(ledPins*, 0);*
}
- // Or else! Or else what? Exactly, turn on the leds*
- else*
{
- //now we have to map 0-1023 to 0-255 since thats the range analogWrite uses*
- LEDbrightness = map(photocellReading0, 851, 1023, 0, 255);*
- // More POWAH, turn them all on*
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
_ analogWrite(ledPins*, LEDbrightness);_
_}*_
//ledpin6-analog1
// If statement to turn of all the leds when below a "normal" reading
if (photocellReading1 < 850)
{
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
_ analogWrite(ledPins*, 0);
}
// Or else! Or else what? Exactly, turn on the leds*
* else*
{
* //now we have to map 0-1023 to 0-255 since thats the range analogWrite uses*
* LEDbrightness = map(photocellReading1, 851, 1023, 0, 255);
// More POWAH, turn them all on*
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
analogWrite(ledPins*, LEDbrightness);
}*_
//ledpin5-analog2
// If statement to turn of all the leds when below a "normal" reading
if (photocellReading2 < 850)
{
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
_ analogWrite(ledPins*, 0);
}
// Or else! Or else what? Exactly, turn on the leds*
* else*
{
* //now we have to map 0-1023 to 0-255 since thats the range analogWrite uses*
* LEDbrightness = map(photocellReading2, 851, 1023, 0, 255);
// More POWAH, turn them all on*
for (int i = 0; i< sizeof(ledPins)/sizeof(ledPins[0]); i++)
analogWrite(ledPins*, LEDbrightness);
}*_
// Debugging only
// Serial.print("Brightness = ");
// Serial.println(LEDbrightness);
* delay(100);*
}