Errors uploading during RGB LED lesson 4

Hi Im trying to do lesson 4 RGB LED. I've uploaded the code. I am getting error codes when uploaded to the Arduino. I am set on "Arduino Uno". which is the unit I have. I'm new to this and don't know what's going on. Thanks.

//www.elegoo.com

//2016.12.8

// Define Pins

#define BLUE 3

#define GREEN 5

#define RED 6

void setup()

{

pinMode(RED, OUTPUT);

pinMode(GREEN, OUTPUT);

pinMode(BLUE, OUTPUT);

digitalWrite(RED, HIGH);

digitalWrite(GREEN, LOW);

digitalWrite(BLUE, LOW);

}

// define variables

int redValue;

int greenValue;

int blueValue;

// main loop

void loop()

{

#define delayTime 10 // fading time between colors

redValue = 255; // choose a value between 1 and 255 to change the color.

greenValue = 0;

blueValue = 0;

// this is unnecessary as we've either turned on RED in SETUP

// or in the previous loop ... regardless, this turns RED off

// analogWrite(RED, 0);

// delay(1000);

for(int i = 0; i < 255; i += 1) // fades out red bring green full when I=255

{

redValue -= 1;

greenValue += 1;

// The following was reversed, counting in the wrong directions

// analogWrite(RED, 255 - redValue);

// analogWrite(GREEN, 255 - greenValue);

analogWrite(RED, redValue);

analogWrite(GREEN, greenValue);

delay(delayTime);

}

redValue = 0;

greenValue = 255;

blueValue = 0;

for(int i = 0; i < 255; i += 1) // fades out green bring blue full when I=255

{

greenValue -= 1;

blueValue += 1;

// The following was reversed, counting in the wrong directions

// analogWrite(GREEN, 255 - greenValue);

// analogWrite(BLUE, 255 - blueValue);

analogWrite(GREEN, greenValue);

analogWrite(BLUE, blueValue);

delay(delayTime);

}

redValue = 0;

greenValue = 0;

blueValue = 255;

for(int i = 0; i < 255; i += 1) // fades out blue bring red full when I=255

{

// The following code has been rearranged to match the other two similar sections

blueValue -= 1;

redValue += 1;

// The following was reversed, counting in the wrong directions

// analogWrite(BLUE, 255 - blueValue);

// analogWrite(RED, 255 - redValue);

analogWrite(BLUE, blueValue);

analogWrite(RED, redValue);

delay(delayTime);

}

}

and the error codes:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Failed uploading: uploading error: exit status 1

'Error: avrdude' when uploading – Arduino Help Center

  • Selected Com port in IDE?
  • double-check the USB connection?
  • Tried another USB cable?
  • checked Windows Device Manager to verify USB enumerated?

Your error codes has nothing to do with "errors in the lesson", so would be better to change the title to not mislead the respondents.
Something like "Error uploading code to the Uno" will fit better

Board is Arduino Uno
Port is /dev/cu.usbmodem14601

Lesson 4 "RGB LED" I am having trouble uploading, and Lesson 5 "Digital Inputs" I am having trouble loading.

I am bringing both to the IDE by opening them under "Code" in the finder.

I was able to do the "blink" lesson presumably because I pulled it from File > Examples > Basics > Blink.

Sure I'll try to change the title.

I'm on Mac OS and using IDE 2.0.4

Yes connections are good thanks.

The port says /dev/cu.usbmodem14601 (Arduino uno)

so I've assumed that's the right one.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.