Problem with colormixinglamp

I am using the Arduino starter kit, I have followed the wiring instructions to the letter. I have downloaded and verified the code. I am new to Arduino so sorry if this is a simple question. Any suggestions would be great.

Quin-mallory:
I am using the Arduino starter kit, I have followed the wiring instructions to the letter. I have downloaded and verified the code. I am new to Arduino so sorry if this is a simple question. Any suggestions would be great.

What’s the problem?

ops sorry! The lamp wont light up at all.

Well, you could post your code here

Sorry again!
/*
Arduino Starter Kit example
Project 4 - Color Mixing Lamp

This sketch is written to accompany Project 3 in the Arduino Starter Kit

Parts required:

  • one RGB LED
  • three 10 kilohm resistors
  • three 220 ohm resistors
  • three photoresistors
  • red green and blue colored gels

created 13 Sep 2012
modified 14 Nov 2012
by Scott Fitzgerald
Thanks to Federico Vanzati for improvements

http://www.arduino.cc/starterKit

This example code is part of the public domain.
*/

const int greenLEDPin = 9; // LED connected to digital pin 9
const int redLEDPin = 10; // LED connected to digital pin 10
const int blueLEDPin = 11; // LED connected to digital pin 11

const int redSensorPin = A0; // pin with the photoresistor with the red gel
const int greenSensorPin = A1; // pin with the photoresistor with the green gel
const int blueSensorPin = A2; // pin with the photoresistor with the blue gel

int redValue = 0; // value to write to the red LED
int greenValue = 0; // value to write to the green LED
int blueValue = 0; // value to write to the blue LED

int redSensorValue = 0; // variable to hold the value from the red sensor
int greenSensorValue = 0; // variable to hold the value from the green sensor
int blueSensorValue = 0; // variable to hold the value from the blue sensor

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);

// set the digital pins as outputs
pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
pinMode(blueLEDPin, OUTPUT);
}

void loop() {
// Read the sensors first:

// read the value from the red-filtered photoresistor:
redSensorValue = analogRead(redSensorPin);
// give the ADC a moment to settle
delay(5);
// read the value from the green-filtered photoresistor:
greenSensorValue = analogRead(greenSensorPin);
// give the ADC a moment to settle
delay(5);
// read the value from the blue-filtered photoresistor:
blueSensorValue = analogRead(blueSensorPin);

// print out the values to the Serial Monitor
Serial.print("raw sensor Values \t red: “);
Serial.print(redSensorValue);
Serial.print(”\t green: “);
Serial.print(greenSensorValue);
Serial.print(”\t Blue: ");
Serial.println(blueSensorValue);

/*
In order to use the values from the sensor for the LED, you need to do some
math. The ADC provides a 10-bit number, but analogWrite() uses 8 bits.
You’ll want to divide your sensor readings by 4 to keep them in range
of the output.
*/
redValue = redSensorValue / 4;
greenValue = greenSensorValue / 4;
blueValue = blueSensorValue / 4;

// print out the mapped values
Serial.print("Mapped sensor Values \t red: “);
Serial.print(redValue);
Serial.print(”\t green: “);
Serial.print(greenValue);
Serial.print(”\t Blue: ");
Serial.println(blueValue);

/*
Now that you have a usable value, it’s time to PWM the LED.
*/
analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);
}

Do the prints show it is doing anything?

what are prints?

 Serial.print("Mapped sensor Values \t red: ");
 Serial.print(redValue);
 Serial.print("\t green: ");
 Serial.print(greenValue);
 Serial.print("\t Blue: ");
 Serial.println(blueValue);

Open the serial monitor and see what is printed.

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/464346330/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/464346330/pinned -libraries /tmp/464346330/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/464346330/p04_ColorMixingLamp Sketch uses 2914 bytes (9%) of program storage space. Maximum is 32256 bytes. Global variables use 274 bytes (13%) of dynamic memory, leaving 1774 bytes for local variables. Maximum is 2048 bytes. Flashing with command:C:/Users/Cassie Arduino/.arduino-create/arduino/avrdude/6.3.0-arduino9/bin/avrdude.exe -CC:/Users/Cassie Arduino/.arduino-create/arduino/avrdude/6.3.0-arduino9/etc/avrdude.conf -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:/Users/CASSIE~1/AppData/Local/Temp/arduino-create-agent228335121/p04_ColorMixingLamp.hex:i avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: reading input file "C:/Users/CASSIE~1/AppData/Local/Temp/arduino-create-agent228335121/p04_ColorMixingLamp.hex" avrdude: writing flash (2914 bytes): Writing | ################################################## | 100% 0.47s avrdude: 2914 bytes of flash written avrdude: verifying flash memory against C:/Users/CASSIE~1/AppData/Local/Temp/arduino-create-agent228335121/p04_ColorMixingLamp.hex: avrdude: load data flash data from input file C:/Users/CASSIE~1/AppData/Local/Temp/arduino-create-agent228335121/p04_ColorMixingLamp.hex: avrdude: input file C:/Users/CASSIE~1/AppData/Local/Temp/arduino-create-agent228335121/p04_ColorMixingLamp.hex contains 2914 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.38s avrdude: verifying ... avrdude: 2914 bytes of flash verified avrdude: safemode: Fuses OK (E:00, H:00, L:00) avrdude done. Thank you.

When the code is running, open the serial monitor and post the results.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Have you got the LED connected the right way round?

Thanks.. Tom.. :)