"SerialRead' was not declared in this scope

here's the code :http://pastebin.com/WrVbu4hf

i know my last question contained this pastebin link but this is a totally different problem.

error : In function 'void loop()': 33:14: error: 'SerialRead' was not declared in this scope

Make that big S a small s. See if that works. Then take the time to learn about the codes you're taking from other people.

In future, please post your code here, between code tags, rather than on another website. Much easier for people to view and help you.

Besides the above-mentioned problem, there are missing/extra curly brackets in a couple of places.

I think this is what you meant:-

//pin definitions
int redPin = 7;
int greenPin = 5;
int bluePin = 6;
int buttonPin = 2;

//serial vars
char commandBuffer[512];
uint8_t buffPos = 0;
byte incomingByte = 0;
String line = "";
bool avail = false;

//button vars
int prev = LOW;
int reading = LOW;

void setup()
{
    Serial.begin(9600);
    pinMode(redPin, OUTPUT);
    pinMode(greenPin, OUTPUT);
    pinMode(bluePin, OUTPUT);
    pinMode(buttonPin, INPUT);
    analogWrite(redPin, 0);
    analogWrite(greenPin, 0);
    analogWrite(bluePin, 0);
}

void loop()
{
    serialRead();
    if (avail)
    {
        avail = false;
        if (line.equals("green"))
            digitalWrite(greenPin, HIGH);
        else if (line.equals("red"))
            digitalWrite(redPin, HIGH);
        else if (line.equals("yellow"))
            digitalWrite(bluePin, HIGH);
    }

    reading = digitalRead(buttonPin);
    if (reading != prev)
    {
        if (reading == HIGH)
            Serial.println("button_high");
        else
            Serial.println("button_low");
        prev = reading;
    }
}

void setColor(int red, int green, int blue)
{
    analogWrite(redPin, red);
    analogWrite(greenPin, green);
    analogWrite(bluePin, blue);
}

void serialRead()
{
    if (Serial.available() > 0)
    {
        incomingByte = Serial.read();
        if (incomingByte == 13)
        {
            line = commandBuffer;
            line.trim();
            avail = true;
            memset(commandBuffer, 0, 100);
            buffPos = 0;
        }
        else
        {
            commandBuffer[buffPos] = incomingByte;
            buffPos++;
        }
    }
}

OldSteve: In future, please post your code here, between code tags, rather than on another website. Much easier for people to view and help you.

Besides the above-mentioned problem, there are missing/extra curly brackets in a couple of places.

I think this is what you meant:-

//pin definitions
int redPin = 7;
int greenPin = 5;
int bluePin = 6;
int buttonPin = 2;

//serial vars char commandBuffer[512]; uint8_t buffPos = 0; byte incomingByte = 0; String line = ""; bool avail = false;

//button vars int prev = LOW; int reading = LOW;

void setup() {     Serial.begin(9600);     pinMode(redPin, OUTPUT);     pinMode(greenPin, OUTPUT);     pinMode(bluePin, OUTPUT);     pinMode(buttonPin, INPUT);     analogWrite(redPin, 0);     analogWrite(greenPin, 0);     analogWrite(bluePin, 0); }

void loop() {     serialRead();     if (avail)     {         avail = false;         if (line.equals("green"))             digitalWrite(greenPin, HIGH);         else if (line.equals("red"))             digitalWrite(redPin, HIGH);         else if (line.equals("yellow"))             digitalWrite(bluePin, HIGH);     }

    reading = digitalRead(buttonPin);     if (reading != prev)     {         if (reading == HIGH)             Serial.println("button_high");         else             Serial.println("button_low");         prev = reading;     } }

void setColor(int red, int green, int blue) {     analogWrite(redPin, red);     analogWrite(greenPin, green);     analogWrite(bluePin, blue); }

void serialRead() {     if (Serial.available() > 0)     {         incomingByte = Serial.read();         if (incomingByte == 13)         {             line = commandBuffer;             line.trim();             avail = true;             memset(commandBuffer, 0, 100);             buffPos = 0;         }         else         {             commandBuffer[buffPos] = incomingByte;             buffPos++;         }     } }

Worked, Thanks!

BreadEatingBoard: Worked, Thanks!

No worries. Glad to help. :)

Edit: I forgot to add - if you use Ctrl-T or ">Tools >Auto Format" in the IDE to format your code, often things like missing or extra braces will become easily visible.