Serial Read, String, Convert ATOI
hey guys, not sure if popular subject have tried looking through google "arduino read string serial convert integer" because issue having number entered in serial user , having character/string converted actual number. code having problems shown below
the error "error: cannot convert 'string' 'const char*' argument '1' 'int atoi(const char*)'". so, unsure of doing wrong. did try
code: [select]
char c = serial.read();
readstring.indexof(c); //i have tried using readstring.concat(c) append
int n;
n = atoi(readstring); //convert string number
the error "error: cannot convert 'string' 'const char*' argument '1' 'int atoi(const char*)'". so, unsure of doing wrong. did try
code: [select]
char *c = serial.read(); , arduino did not either. appreciated.
http://arduino.cc/en/reference/stringtochararray ?
Arduino Forum > Using Arduino > Programming Questions > Serial Read, String, Convert ATOI
arduino
Comments
Post a Comment