Created
March 11, 2015 22:24
-
-
Save tomhartley/e44f4c991eb225365e34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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