ERROR- 'mainColors () ; was not declared in scope.

First off, sorry if my code looks wierd, I'm a newb. Anyways, I was experimenting with making new functions in the void loop functions when this message keeps apearing at the "mainColors () ;" located in the void loop function. Can anyone tell me why it keeps saying "mainColors () ;" was not declared in scope? (And if I did misplace this fourm or just did something unwanted, please notify me so I don't keep doing it.)

const int RED = 9 ;
const int GREEN = 10 ;
const int BLUE = 11 ;
int DISPLAY_TIME = 100;
void setup ()
{
pinMode (RED,OUTPUT) ;
pinMode (GREEN,OUTPUT) ;
pinMode (BLUE,OUTPUT) ;
}
void loop ()
{
mainColors () ;
}
void mainColors ()
digitalWrite (RED,HIGH) ;
digitalWrite (GREEN,LOW) ;
digitalWrite (BLUE,LOW) ;
delay (1000) ;
digitalWrite (RED,LOW) ;
digitalWrite (GREEN,HIGH) ;
digitalWrite (BLUE,LOW) ;
delay (1000) ;
digitalWrite (RED,LOW) ;
digitalWrite (GREEN,LOW) ;
digitalWrite (BLUE,HIGH) ;
delay (1000) ;
}

Your first post...welcome. You're missing the opening brace on the function:

void mainColors () {      // Note the opening brace at the end of the line

BTW, please read the first two posts on this Forum, which lay down the guidelines for posts to the Forum. The guidelines will help you get responses from the readers. First, please post your code using code tags. Second, try to reformat your code before posting using Ctrl-T in the IDE source window. These and other things should help you down the road.

Derp, thanks for the quick reply! It work's now :grin: