converting char to int

Hello, yes it's because of the type of the variable "number": http://arduino.cc/en/Reference/Int

You can change:

int number = atoi( input );

to

long number = atol( input ); //notice the function change to atoL

or, if you want to use only positive values:

unsigned long number = strtoul( input, NULL, 10 );

:slight_smile:

1 Like