convert a char array of numbers into an integer

Hi,
I think that you need to use atoi().

char buffer[4];
buffer[0] = command[1];
buffer[1] = command[2];
buffer[2] = command[3];
buffer[3] = '\0';

int  n;
n = atoi(buffer);
1 Like