Basically, I need 3 `u_int8` representing RGB. So a value might look like `ff89c2` for a pinkish color (basically I'm sending a hex value). So far I've got my server connected to my wifi. I've been able to send test packages with Hercules but I can't seem to parse the data correctly and end up getting random characters printed to the console. My loop looks something like the following:
void loop() {
// listen for incoming clients
client = server.available();
// exit if no connection
if (!client) { return; }
else {
Serial.println("Client connected");
while (client.connected()){
if (client.read() > 0) {
data = client.read();
Serial.println(data);
}
}
}
}
So my question is: is TCP or UDP the best way to go for this sort of thing (I want low latency as I want to drive the lights with music), and how to I read the "body" of an incoming request?
Thanks!