I am working on a piece of arduino code that uses a version of BlackWidow with built-in Wi-Fi. Using the WiServer.h library, I use the SimpleClient.pde example with mods to send a call to a web server, which will simply return an integer - 0, 1 or 2. The final goal is to turn on the pin for the correct red, green or yellow brake light . Integers represent the cumulative state of our Hudson CI.
I'm the lazy bastard of PHP, and pointers scare me. The code I'm working with
void printData(char* data, int len) {
while (len-- > 0) {
Serial.print(*(data++));
}
}
printData () is a callback to a web server, and when it starts, it sends the following to the serial monitor (these are three loops, a new line before a new exit):
HTTP/1.1 200 OK
Date: Thu, 10 Feb 2011 17:37:37 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 PHP/5.2.11
X-Powered-By: PHP/5.2.11
Content-Length: 1
Connection: close
Content-Type: text/html
0HTTP/1.1 200 OK
Date: Thu, 10 Feb 2011 17:37:45 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 PHP/5.2.11
X-Powered-By: PHP/5.2.11
Content-Length: 1
Connection: close
Content-Type: text/html
0HTTP/1.1 200 OK
Date: Thu, 10 Feb 2011 17:37:58 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 PHP/5.2.11
X-Powered-By: PHP/5.2.11
Content-Length: 1
Connection: close
Content-Type: text/html
0
The part I need to identify is 0, which can also be 1 or 2.
printData() turnOnAppro Light() - , HIGH. .
, , , . * (Data ++) - , , ... , char . , .

