Converting int into char array.

a little late for the original poster but it might help others;

a simple way that works for me to convert int to char array is to convert the int to string and then to char.

int a = 128;
String b;
char c[3];

b = (string)a;
b.toCharArray(c, 3);

then I can send it in my case:

radio.write(&c, sizeof(c));

1 Like