serial read error help

butthis code still does not fallow through with the function

Take a look at ALL the places where readString appears. Show ALL the places where readString gets data added to it. I'll wait.

im thinking nowhere .....

so if the string is coming from the serial read and char c is serial read would i make readstring = c ?

im thinking nowhere .....

NOW you are thinking correctly.

so if the string is coming from the serial read and char c is serial read would i make readstring = c ?

No, you would APPEND the character to readString:

   readString += c;

alright so now i have it printing in uppercase but still no function and it serial prints both literal and upper case muiltiple times

#include <MotorDriver.h>
String readString;
void setup()
{
  Serial.begin(57600);
}
void loop()
{
  if (Serial.available())
  {
    char c = Serial.read();  //gets one byte from serial buffer
    Serial.print(c);
    readString += c; //makes the string readString
    if (readString.length() > 0)
    {
      readString.toUpperCase();
      Serial.println(readString);
      if (readString == "SQUARE JUST PRESSED")
      {
        motordriver.goForward();
      }
     }
  }
}

You still print each letter:

Serial.print(c);

And the whole recieved buffer:

Serial.println(readString);

So thats to be expected.

Currently you have no way to clear that buffer, You'll need some sort of delimiter to trigger the clear, the character /r should work.

so

if( c == '/r' )
{
      if (readString == "SQUARE JUST PRESSED")
      {
        motordriver.goForward();
      }
      readString = "";
}

tammytam:
Currently you have no way to clear that buffer, You'll need some sort of delimiter to trigger the clear, the character /r should work.

so

if( c == '/r' )

{
     if (readString == "SQUARE JUST PRESSED")
     {
       motordriver.goForward();
     }
     readString = "";
}

'/r' is two characters. '\r' is one character. / is slash. \ is backslash and is an escape character in C.

still is doing the same after adding that

#include <MotorDriver.h>
String readString;
void setup()
{
  Serial.begin(57600);
}
void loop()
{
  if (Serial.available())
  {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    if (readString.length() > 0)
    {
      readString.toUpperCase();
      Serial.println(readString);
      if ( c == '/r' )
      {
        if (readString == "SQUARE JUST PRESSED")
        {
          motordriver.goForward();
        }
        readString = "";
      }
    }
  }
}

Read what christop said. I used the incorrect slash, time to call it a day for me I think ;).

Ok I'll try it thanks everyone

ok changed the slash and it works but im still not getting it to "goForward" when the SQUARE JUST PRESSED is recieved......

alright so now i have it printing in uppercase but still no function and it serial prints both literal and upper case muiltiple times

Because that is what you told it to do. If you, as I suspect, only want to check readString after the \n or \r arrives, then you need to make some changes.

    if (readString.length() > 0)

should be

if(c == '\n' || c == '\r')

You'll also need to reset readString to an empty string somewhere.

i made the changes still no forward movement

#include <MotorDriver.h>
String readString;
void setup()
{
  Serial.begin(57600);
}
void loop()
{
  if (Serial.available())
  {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
   if(c == '\n' || c == '\r')
    {
      readString.toUpperCase();
      Serial.println(readString);
      if ( c == '\r' )
      {
        if (readString == "SQUARE JUST PRESSED")
        {
          motordriver.goForward();
        }
        readString = "";
      }
    }
  }
}

code correction

#include <MotorDriver.h>
String readString;
void setup()
{
  Serial.begin(57600);
}
void loop()
{
  if (Serial.available())
  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == '\n' || c == '\r')
    {
      readString.toUpperCase();
      Serial.println(readString);
      if ( c == '\r' )
      {
        if (readString == "SQUARE JUST PRESSED")
        {
          motordriver.goForward();
        }
      }
      readString = ""; //clears variable for new input
    }
    else
    {
      readString += c; //makes the string readString
    }
  }
}

Perhaps you should reexplain in detail just what you want/expect your code to do.

For now when it receives "square just pressed" I want it to fallow through with the motordtiver function goforward

merkzilla:
For now when it receives "square just pressed" I want it to fallow through with the motordtiver function goforward

Maybe something simple to start with.

// zoomkat 8-6-10 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

//A very simple example of sending a string of characters 
//from the serial monitor, capturing the individual 
//characters into a String, then evaluating the contents 
//of the String to possibly perform an action (on/off board LED).

int ledPin = 13;
String readString;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 
  Serial.println("serial on/off test 0021"); // so I can keep track
}

void loop() {

  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }

  if (readString.length() >0) {
    Serial.println(readString);

    if(readString.indexOf("on") >=0)
    {
      digitalWrite(ledPin, HIGH);
      Serial.println("LED ON");
    }

    if(readString.indexOf("off") >=0)
    {
      digitalWrite(ledPin, LOW);
      Serial.println("LED OFF");
    }

    readString="";
  } 
}
      Serial.println(readString);

I HATE crap like this. Learn what is REALLY in readString by printing it better:

Serial.print("readString = >");
Serial.print(readString);
Serial.println("<");

If you see:
readString = >SQUARE JUST PRESSED<
you have learned one thing.

If you see:
readString = >SQUARE JUST PRESSED
<
you have learned something else.

With your method, the output would look the same, and you can NOT tell what is REALLY in readString.

SQUARE JUST PRESSED
readString = >SQUARE JUST PRESSED<

readString = ><
SQUARE JUST RELEASED
readString = >SQUARE JUST RELEASED<

readString = ><

so guess ive learned one thing but im missing something else what does this mean?