HowTo-Color (8) / Hacking Electronics / Simon Monk / 236-3 / Chapter 6
136
Hacking Electronics we use in the “loop” function to ignore the icon request from the browser. int valueOfParam(char param) { for (int i = 0; i < strlen(line1); i++) { if (line1[i] == param && line1[i+1] == '=') { return (line1[i+2] - '0'); } } return 0; }
The “valueOfParam” lets you read the value of the request parameter supplied as an argument. This is much more restricted than the kind of request parameter you will be used to if you have done any web programming. First, the request parameter name must be a single character, and second, its value must be a single digit between 0 and 9. The function will return the value or 0 if there is no parameter of that name. This is one of those projects that can be adapted for all sorts of purposes.
How to Use an Alphanumeric LCD Shield with Arduino Another commonly used Arduino shield is the LCD shield (Figure 6-28).
06-ch06.indd 136
Figure 6-28 An LCD shield
1/2/13 11:56 AM