char data[] = {"9005, 4400, 1600, 565"};
// Am ende des data-Arrays speichert der Compiler einen
// Nullterminator '\0' = 0 als Integerwert
unsigned int irRawData[300];
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
unsigned int bufferIndex = 0;
for(int i = 0; data[i] != '\0'; i++) {
if (data[i] >= '0' && data[i] <= '9')
irRawData[bufferIndex] = irRawData[bufferIndex] * 10 + data[i] - '0';
else if (data[i] == ' ')
bufferIndex++;
}
for(int i = 0; i < 4; i++)
{
Serial.println(irRawData[i] * 2);
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}