My Arduino program receives a char* text message like this:
char* messageFromWebSocket = "4692\n4408\n656\n358\n662\n356\n658\n376\n656\n358\n662\n1394\n660\n1392\n636\n378\n632\n382\n638\n1418";
Now the IRremoteESP8266 library I used controls the IR LED through the sendRaw() function using this data, but in uint16_t form. Example:
uint16_t rawData[39] = {9064, 4408, 580, 4408, 580, 2152, 578, 2150,
580, 4408, 580, 30622, 9066, 2148, 580};
irsend.sendRaw(rawData, 39, 39);
Is there any way to convert my char* to uint16_t ?
I have:
char* messageFromWebSocket = "4692\n4408\n656\n358\n662\n356\n658\n376\n656\n358\n662\n1394\n660\n1392\n636\n378\n632\n382\n638\n1418";
I want get:
uint16_t* rawData = {4692, 4408, 656, 358, 662, 356, 658, 376, 656, 358, 662, 1394, 660, 1392, 636, 378, 632, 382, 638, 1418};
The size of the rawData will vary depending on the messageFromWebSocket, because each time the program passes, there is different data there. Thank you in advance for your help because I have no idea how to solve this.