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

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

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial