Newbie Q number 2

Hi there

Im sill in early stages of learning but getting an error on the following code

// colour mixing lamp 

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);
}

  // put your setup code here, to run once:

void loop() {
  redSensorValue = analogRead(redSensorPin);
  delay(5);
  greenSensorValue = analogRead(greenSensorPin);
  delay(5);
  blueSensorValue = analogRead(blueSensorPin);
  delay(5);
  Serial.print("Raw Sensor Values \t Red ");
  Serial.print(redSensorValue);
  Serial.print("\t Green ");
  Serial.print(greenSensorValue);
  Serial.print("\t Blue ");
  Serial.print("bluenSensorValue");
  redValue = redSensorValue/4;
  greenValue = greenSensorValue/4;
  blueValue = blueSensorValue/4; 
  Serial.print("Mapped Sensor Value \t Red ");
  Serial.print(redValue);
  Serial.print("\t Green ");
  Serial.print(greenValue);
  Serial.print("\t Blue ");
  Serial.print("blueValue");
  analogWrite(redLEDPin, redValue);
  analogWrite(greenLEDPin, greenValue); 
  analogWrite(blueLEDPin, blueValue);
}

Error shows as

od_sensor.ino: In function 'void setup()':
/Users/Debstar/Downloads/Arduino-2.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant
#define OUTPUT 0x1
^
mood_sensor.ino:21:23: note: in expansion of macro 'OUTPUT'
/Users/Debstar/Downloads/Arduino-2.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant
#define OUTPUT 0x1
^
mood_sensor.ino:22:21: note: in expansion of macro 'OUTPUT'
/Users/Debstar/Downloads/Arduino-2.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant
#define OUTPUT 0x1
^
mood_sensor.ino:23:22: note: in expansion of macro 'OUTPUT'
Error compiling.

So i know theres a problem with line 21-23 but i copied exactly from my project book even though i thought it looked wrong - is it testing me!? ha

what does this part mean please?

error: expected unqualified-id before numeric constant
#define OUTPUT 0x1

huge thanks - when i get good i promise to help back! x

Shouldn't those be commas between the arguments to pinMode rather than periods?

If you find the line(s) with a problem, you can check the syntax.

It appears that you didn't post all of your code because the first error message refers to:

#define OUTPUT 0x1

which is not in the code you posted.

The code will compile if you fix the pinMode statements.
Tom

econjack:
pinMode(greenLEDPin.OUTPUT);

Make that dot a comma.

i copied exactly from my project book

Which project book?

Just lose all the "pinMode" - they're unnecessary