Arduino starter kit - colour mixing lamp compiling error - solved


My code has an error that I don't understand. It highlights the last line of the "Serial.begin" code = pinMode(blueLEDPin),OUTPUT);

exit status 1
too few arguments to function 'void pinMode(uint8_t, uint8_t)'

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() {
void loop() {
  redSensorValue = analogRead(redSensorPin);
    greenSensorValue = analogRead(greenSensorPin);
    blueSensorValue = analogRead(blueSensorPin);
 Serial.print("Raw Sensor Values \t Red: ");
 Serial.print("\t Green: ");
   Serial.print("\t Blue: ");
redValue = redSensorValue/4;
greenValue = greenSensorValue/4;
blueValue = blueSensorValue/4;
Serial.print("Mapped Sensor Values \t Red: ");
Serial.print("\t Green: ");
Serial.print("\t Blue: ");
analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);


Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool. I recommend you to use the standard IDE instead.

You must not have correctly copied the code. Please read:
and then take a close look at this part of your code:


and see if you can figure out what you did wrong.

Here's a little tip:
All the starter kit sketches are available in the Arduino IDE at File > Examples > 10.StarterKit_BasicKit. It will be something similar to that in the Arduino Web Editor.

Wow thank you so much! My first post and answered almost immediately. I see I added in an extra ")".

In the future I will know how to use the autoformat, and I will search the reference guide regards the line of code as well. Awesome.

Glad I was able to help. Enjoy!