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?
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) ...