Help in Arduino Codes

Discussion in 'Programmer's Corner' started by brian25, Aug 27, 2013.

  1. brian25

    Thread Starter Member

    May 13, 2013
    37
    0
    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 ( (Unknown Language)):
    1. char x;
    2. n[20];
    3.  
    4.      
    5.       if((x, n)>0)   // Number, Number length
    6.       {
    7.       String num=x;
    8.       if(num.equals("12345")){
    9.       Serial.print("Ok");
    10.      }
    11.      else{
    12.      Serial.print("Done");
    13. }
     
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
Loading...