invalid conversion from 'char' to 'const char*' [-fpermissive]

Hi Guys:

I am trying to use transfer the string from MATLAB2013a to Arduino Board Uno. However i meet the error: invalid conversion from 'char' to 'const char*' [-fpermissive] at the (strcmp(receivedChar,"g")==0) when i upload it into the board. What should i do in order to resolve this problem?

Arduino Code

char receivedChar;
boolean newData = false;

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() {
    recvOneChar();
    showNewData();
}

void recvOneChar() {
    if (Serial.available() > 0) {
        receivedChar = Serial.read();
        newData = true;
        if (strcmp(receivedChar,"g")==0)
    {
      digitalWrite(ledPin,HIGH);
      delay(1000);
  }
  else {
  digitalWrite(ledPin,LOW);
}
    }
}

void showNewData() {
    if (newData == true) {
        Serial.print("This just in ... ");
        Serial.println(receivedChar);
        newData = false;
    }
}

For single character comparison use just

if (receivedChar == 'g')

oqibidipo:
For single character comparison use just

if (receivedChar == 'g')

If i wanna send a string "good luck" to arduino board, what should i change in the code??

There is a thread called 'Serial input basics - updated' by Robin2.

Search for it, read it,understand it and get ideas how to implement your communication.

i meet the error: invalid conversion from 'char' to 'const char*' [-fpermissive] at the if (strcmp(receivedChar,"g")==0) when i upload it into the board. What should i do in order to resolve this problem?

Note that the problem is not with the "g" in your original code. Although it could be treated more efficiently as a single character, C has no problems treating it as string like that. The problem is with the other parameter of strcmp. Both parameters need to be cstrings, so receivedChar needs to be a string not a char.

cwhen4:
If i wanna send a string "good luck" to arduino board, what should i change in the code??

char* receivedStr;
...
if (strcmp(receivedStr,"good luck")==0) ...