Skip to content

Instantly share code, notes, and snippets.

@tomhartley
Created March 11, 2015 22:24
Show Gist options
  • Save tomhartley/e44f4c991eb225365e34 to your computer and use it in GitHub Desktop.
Save tomhartley/e44f4c991eb225365e34 to your computer and use it in GitHub Desktop.
tStart = (unsigned) millis();
}
break;
// look for the echo back
case READ:
// see if we got anything to read
if((cbRead = tcpClient.available()) > 0)
{
cbRead = cbRead < sizeof(rgbRead) ? cbRead : sizeof(rgbRead);
cbRead = tcpClient.readStream(rgbRead, cbRead);
for(int i=0; i < cbRead; i++)
{
Serial.print(rgbRead[i], BYTE);
}
}
// give us some time to get everything echo'ed back
else if( (((unsigned) millis()) - tStart) > tWait )
{
Serial.println("");
state = CLOSE;
}
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment