string to int (pwm)

atoi() expects a pointer to a zero-delimited string, not just a single character.

Just add an asterisk (*) to the variable declaration and keep using double quotes for the string:

char * thisChar = "A";
int a = atoi(thisChar);