Help in Arduino Codes

Status
Not open for further replies.

brian25

Member level 2
Joined
Feb 18, 2013
Messages
52
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,601
hi sir/ma'am how to convert a char to a string?

i got this error.

sketch_aug27a:90: error: invalid conversion from 'char' to 'const char*'
sketch_aug27a:90: error: initializing argument 1 of 'String::String(const char*)'
sketch_aug27a:93: error: invalid conversion from 'char' to 'const char*'
sketch_aug27a:93: error: initializing argument 1 of 'unsigned char String::equals(const char*) const'



Code:
char x;
n[20];

     
      if((x, n)>0)   // Number, Number length
      {
      String num=x;
      if(num.equals("12345")){
      Serial.print("Ok");
     }
     else{
     Serial.print("Done");
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…