Hardware Reference
In-Depth Information
digitalWrite(pin, !digitalRead(pin));
break;
}
//A speaker command is specified with an S
else if (c == 'S')
{
Serial.print("Setting Frequency to ");
freq = client.parseInt();
Serial.println(freq);
if (freq == 0)
noTone(SPEAKER);
else
tone(SPEAKER, freq);
break;
}
//Add similarly formatted else if statements here
//TO CONTROL ADDITIONAL THINGS
}
//Print out the response header and the HTML page
if(!sentHeader)
{
//Send a standard HTTP response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html\n");
//Red toggle button
client.println("<form action='' method='get'>");
client.println("<input type='hidden' name='L' value='7' />");
client.println("<input type='submit' value='Toggle Red' />");
client.println("</form>");
//Green toggle button
client.println("<form action='' method='get'>");
client.println("<input type='hidden' name='L' value='6' />");
client.println("<input type='submit' value='Toggle Green' />");
client.println("</form>");
//Blue toggle button
client.println("<form action='' method='get'>");
client.println("<input type='hidden' name='L' value='5' />");
client.println("<input type='submit' value='Toggle Blue' />");
client.println("</form>");
//Speaker frequency slider
client.println("<form action='' method='get'>");
client.print("<input type='range' name='S' min='0' max='1000'
step='100' value='0'/>");
client.println("<input type='submit' value='Set Frequency' />");
client.println("</form>");
Search WWH ::




Custom Search