Compiling error

I am in a Mac with ElCapitan operating system.
I am in Project 04 Color Mixing Lamp.
I have copied the Sketch out of the book and visually rechecked my work with no obvious problems transcribing the Sketch.
I get these errors compiling:
sketch_apr09b.ino: In function "void setup()":
sketch_apr09b.ino:16:11: error: "greenLEDPin" was not declared in this scope
sketch_apr09b.ino:17:11: error: "redLEDPin" was not declared in this scope
sketch_apr09b.ino:18:11: error: "blueLEDPin" was not declared in this scope
sketch_apr09b.ino: In function "void loop()":
sketch_apr09b.ino:41:15: error: "redLEDPin" was not declared in this scope
sketch_apr09b.ino:42:15: error: "greenLEDPin" was not declared in this scope
sketch_apr09b.ino:43:15: error: "blue LEDPin" was not declared in this scope

I would be very grateful if someone could tell me how "to declare" these pins.
Also inform me as to what "this scope" is.

Many thanks, cbcademd.

would you please post your arudino code?

Using code tags please

** **[code]** **
your code here
** **[/code]** **
willl result in

your code here

How do I find out what my code or code tag is?

cbcademd:
How do I find out what my code or code tag is?

Your code is the stuff you typed into the Arduio IDE window. All the program you wrote. The code that produced those errors. That's what we want to see so maybe we stand some tiny chance of seeing where your error is.

Info on code tags can be found here: How to Use This Forum. See point #7 about code tags.

Thank you very much to all who commented. cbcademd

Just a thank you? No code? So the error magically fixed itself?

Since I don't know the answers to the questions about code, code tags and since I don't know how to upload the code to the Forum, I will withdraw my compiling problem for now and post it at a later date. cbcademd.

Its easy, try this: :slight_smile:

How to post your code in the Arduino forum:

After you have typed your message, start the Arduino IDE if not already running and load or type in your code (sketch).
Right click in the editor window then left click [Select All].
Right click again then left click [Copy].
In the forum [New Topic] or [Reply] page, click the

</>

code symbol in the upper left.
Right click in the box that appears then left click [Paste].

Or type:

[code]

Type or
paste your
code here

[/code]

Delta_G:
Your code is the stuff you typed into the Arduio IDE window. All the program you wrote. The code that produced those errors. That's what we want to see so maybe we stand some tiny chance of seeing where your error is.

Info on code tags can be found here: How to Use This Forum. See point #7 about code tags.

Did you see this post? Read that link and you'll get all the answers about posting code that you could possibly need.

const int greenLEDpin = 9;
const int redLEDpin = 11;
const int blueLEDpin = 10;
const int redSensorPin = A0;
const int greenSensorPin = A1;
const int blueSensorPin = A2;
int redValue = 0;
int greenValue = 0;
int blueValue = 0;
int redSensorValue = 0;
int greenSensorValue = 0;
int blueSensorValue = 0;
void setup() {
  Serial.begin(9600);
  pinMode(greenLEDPin,OUTPUT);
  pinMode(redLEDPin,OUTPUT);
  pinMode(blueLEDPin,OUTPUT);
}
void loop() {
  redSensorValue = analogRead(redSensorPin);
  delay(5);
  greenSensorValue = analogRead(greenSensorPin);
  delay(5);
  blueSensorValue = analogRead(blueSensorPin);
  Serial.print("Raw Sensor Values \t Red: ");
  Serial.print(redSensorValue);
  Serial.print("\t Green: ");
  Serial.print(greenSensorValue);
  Serial.print("\t Blue: ");
  Serial.println(blueSensorValue);
  redValue = redSensorValue/4;
  greenValue = greenSensorValue/4;
  blueValue = blueSensorValue/4;
  Serial.print("Mapped Sensor Values \t Red: ");
  Serial.print(redValue);
  Serial.print("\t Green: ");
  Serial.print(greenValue);
  Serial.print("\t Blue: ");
  Serial.println(blueValue);
  analogWrite(redLEDPin, redValue);
  analogWrite(greenLEDPin, greenValue);
  analogWrite(blueLEDPin, blueValue);
}/code]

greenLEDpin and greenLEDPin are not the same (capitalization). C++ is case sensitive.

Thanks to all of you who took time to inform me of the compiling problem, especially Outsider who showed me how to upload the code and who also found the problem with the code. I changed those three lower case p to P and that cured my problem. Thanks Outsider, you are a good person. cbcademd