RGB&LED.Runway.jcj.3.4.2020

I am trying to figure out where I am going wrong with this code. Please help me.

const int red = 45;
const int white = 46;
const int red1 = 47;
const int red2 = 48;
const int white1 = 49;
const int red3 = 50;
const int red4 = 51;
const int white2 = 52;
const int red5 = 53;

const int rgbr1 = 11;
const int rgbg1 = 12;
const int rgbb1 = 13;
const int rgbr2 = 8;
const int rgbg2 = 9;
const int rgbb2 = 10;
const int rgbr3 = 5;
const int rgbg3 = 6;
const int rgbb3 = 7;
const int rgbr4 = 4;
const int rgbg4 = 3;
const int rgbb4 = 2;
const int rgbr5 = 17;
const int rgbg5 = 18;
const int rgbb5 = 19;
const int rgbr6 = 22;
const int rgbg6 = 23;
const int rgbb6 = 24;
const int rgbr7 = 27;
const int rgbg7 = 26;
const int rgbb7 = 25;
const int rgbr8 = 33;
const int rgbg8 = 32;
const int rgbb8 = 31;
const int rgbr9 = 36;
const int rgbg9 = 35;
const int rgbb9 = 34;
const int rgbr10 = 14;
const int rgbg10 = 15;
const int rgbb10 = 16;

void setup ()
{
pinMode (red, OUTPUT);
pinMode (white, OUTPUT);
pinMode (red1, OUTPUT);
pinMode (red2, OUTPUT);
pinMode (white1, OUTPUT);
pinMode (red3, OUTPUT);
pinMode (red4, OUTPUT);
pinMode (white2, OUTPUT);
pinMode (red5, OUTPUT);

pinMode (rgbr1, OUTPUT);
pinMode (rgbg1, OUTPUT);
pinMode (rgbb1, OUTPUT);
pinMode (rgbr2, OUTPUT);
pinMode (rgbg2, OUTPUT);
pinMode (rgbb2, OUTPUT);
pinMode (rgbr3, OUTPUT);
pinMode (rgbg3, OUTPUT);
pinMode (rgbb3, OUTPUT);
pinMode (rgbr4, OUTPUT);
pinMode (rgbg4, OUTPUT);
pinMode (rgbb4, OUTPUT);
pinMode (rgbr5, OUTPUT);
pinMode (rgbg5, OUTPUT);
pinMode (rgbb5, OUTPUT);
pinMode (rgbr6, OUTPUT);
pinMode (rgbg6, OUTPUT);
pinMode (rgbb6, OUTPUT);
pinMode (rgbr7, OUTPUT);
pinMode (rgbg7, OUTPUT);
pinMode (rgbb7, OUTPUT);
pinMode (rgbr8, OUTPUT);
pinMode (rgbg8, OUTPUT);
pinMode (rgbb8, OUTPUT);
pinMode (rgbr9, OUTPUT);
pinMode (rgbg9, OUTPUT);
pinMode (rgbb9, OUTPUT);
pinMode (rgbr10, OUTPUT);
pinMode (rgbg10, OUTPUT);
pinMode (rgbb10, OUTPUT);

}
void loop ()

{
for (int i = 0; i<5; i++)
{

rgb1 (255,0,0);
rgb2 (255,0,0);
rgb3 (255,0,0);
rgb4 (255,0,0);
rgb5 (255,0,0);
rgb6 (255,0,0);
rgb7 (255,0,0);
rgb8 (255,0,0);
rgb9 (255,0,0);
rgb10 (255,0,0);

digitalWrite (red, HIGH);
digitalWrite (white, HIGH);
digitalWrite (red1, HIGH);
digitalWrite (red2, HIGH);
digitalWrite (white1, HIGH);
digitalWrite (red3, HIGH);
digitalWrite (red4, HIGH);
digitalWrite (white2, HIGH);
digitalWrite (red5, HIGH);
delay (500);
digitalWrite (red, LOW);
digitalWrite (white, LOW);
digitalWrite (red1, LOW);
digitalWrite (red2, LOW);
digitalWrite (white1, LOW);
digitalWrite (red3, LOW);
digitalWrite (red4, LOW);
digitalWrite (white2, LOW);
digitalWrite (red5, LOW);
delay (500);

}
}

void rgb1 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr1, red);
analogWrite (rgbg1, green);
analogWrite (rgbb1, blue);
}
void rgb2 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr2, red);
analogWrite (rgbg2, green);
analogWrite (rgbb2, blue);
}
void rgb3 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr3, red);
analogWrite (rgbg3, green);
analogWrite (rgbb3, blue);
}
void rgb4 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr4, red);
analogWrite (rgbg4, green);
analogWrite (rgbb4, blue);
}
void rgb5 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr5, red);
analogWrite (rgbg5, green);
analogWrite (rgbb5, blue);
}
void rgb6 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr6, red);
analogWrite (rgbg6, green);
analogWrite (rgbb6, blue);
}
void rgb7 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr7, red);
analogWrite (rgbg7, green);
analogWrite (rgbb7, blue);
}
void rgb8 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr8, red);
analogWrite (rgbg8, green);
analogWrite (rgbb8, blue);
}
void rgb9 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr9, red);
analogWrite (rgbg9, green);
analogWrite (rgbb9, blue);
}
void rgb10 (unsigned char red, unsigned char green, unsigned char blue)
{
analogWrite (rgbr10, red);
analogWrite (rgbg10, green);
analogWrite (rgbb10, blue);

rgb1 (0,0,255);
digitalWrite (red, HIGH); digitalWrite (white, HIGH); digitalWrite (red1, HIGH); delay (500);
rgb2 (0,0,255);
digitalWrite (red2, HIGH); digitalWrite (white1, HIGH); digitalWrite (red3, HIGH); delay (500);
rgb3 (0,0,255);
digitalWrite (red4, HIGH); digitalWrite (white2, HIGH); digitalWrite (red5, HIGH); delay (500);
rgb4 (0,0,255);
digitalWrite (red, LOW); digitalWrite (white, LOW); digitalWrite (red1, LOW); delay (500);
rgb5 (0,0,255);
digitalWrite (red2, LOW); digitalWrite (white1, LOW); digitalWrite (red3, LOW); delay (500);
rgb6 (0,0,255);
digitalWrite (red4, LOW); digitalWrite (white2, LOW); digitalWrite (red5, LOW); delay (500);
rgb7 (0,0,255);
digitalWrite (red, HIGH); digitalWrite (white, HIGH); digitalWrite (red1, HIGH); delay (500);
rgb8 (0,0,255);
digitalWrite (red2, HIGH); digitalWrite (white1, HIGH); digitalWrite (red3, HIGH); delay (500);
rgb9 (0,0,255);
digitalWrite (red4, HIGH); digitalWrite (white2, HIGH); digitalWrite (red5, HIGH); delay (500);
rgb10 (0,0,255);
digitalWrite (red, LOW); digitalWrite (white, LOW); digitalWrite (red1, LOW); delay (500);
rgb1 (0,0,255);
digitalWrite (red2, LOW); digitalWrite (white1, LOW); digitalWrite (red3, LOW); delay (500);
rgb2 (0,0, 255);
digitalWrite (red4, LOW); digitalWrite (white2, LOW); digitalWrite (red5, LOW); delay (500);

}

It’s too long, it’s missing code tags, and it’s in the wrong forum section.

And you didn’t tell us what the problem is

:slight_smile: Thank you for your reply. Where should I go and what should I do? This is the error I keep getting:

Sketch uses 2414 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_setparm(): failed to set parameter 0x9e
avrdude: stk500v2_command(): unknown status 0xc8
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500v2_command(): unknown status 0x01
avrdude: stk500v2_disable(): failed to leave programming mode
An error occurred while uploading the sketc

@jjohnson21789

Moved your topic to it's current location as it is more suitable.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

I've deleted your other cross-post @jjohnson21789.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

jjohnson21789:
I am trying to figure out where I am going wrong with this code.

jjohnson21789:
This is the error I keep getting:

This error has nothing to do with your code. This will happen no matter what code you are uploading.

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to “Show verbose output during: compilation”
  • Check the checkbox next to "Show verbose output during: upload
  • Click “OK”
  • Start an upload
  • After the upload fails, you’ll see a button on the right side of the orange bar “Copy error messages” (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.