// Create a client connection
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();
//read char by char HTTP request
if (readString.length() < 30)
{
//store characters to string
readString += c;
}
//output chars to serial port
//Serial.print(c);
//if HTTP request has ended
if (c == '\n') {
if(readString.substring( 6, 7 ) == 'L')
{
string_temp = readString.substring( 8, 9 );
to_int_temp[0] = string_temp[0];
input_nu = atoi(to_int_temp);
switch(input_nu)
{
case 1:
for(int i = 0; i < 5000; i ++)
{
if(irrecv.decode(&results))
{
showIRProtocol(&results);
irrecv.resume();
}
delay(1);
}
break;
default:
break;
}
}
input_nu = 0;
// now output HTML data starting with standart header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
//set background to yellow
client.print("<body style=background-color:yellow>");
//send first heading
client.println("<font color='red'><h1>Netown test IR control html</font></h1>");
client.println("</body></html>");
//clearing string for next read
readString="";
//stopping client
client.stop();
}
}
}
}
}作者: sinocgt 時間: 2011-9-19 11:10
你可能需要在HTML語法中埋入timer,固定一段時間就去sync server!作者: pizg 時間: 2011-10-8 22:53
請問各位前輩, 我依照coopermaa大在 http://coopermaa2nd.blogspot.com/2011/03/11.html
的做法上傳程式後出現
IRsend::sendSharp(long unsigned int, int)':
D:\PizG\Arduino\arduino-1.0-rc1\libraries\IRremote\IRremote.cpp:689: error: 'delay' was not declared in this scope
請問要如何解決?作者: coopermaa 時間: 2011-10-14 18:50
你上傳的是我 http://coopermaa2nd.blogspot.com/2011/03/11.html 這篇
裏面的範例程式就出現這個問題嗎?還是你上傳的是你自己寫的程式?
我發現你用的是 arduino-1.0-rc1,而我之前是用 arduino-0022
不曉得跟 arduino ide 版本有沒有關,待會我試試看作者: coopermaa 時間: 2011-10-14 18:57
還真的是 Arduino IDE 版本的問題耶!用 Arduino-1.0rc 版本編譯會失敗:
'uint8_t' does not name a type
struct irparams_t' has no member named 'rawlen'
D:\PizG\Arduino\arduino-1.0-rc1\libraries\IRremote\IRremote.cpp:529: error: 'volatile struct irparams_t' has no member named 'rawlen'作者: coopermaa 時間: 2011-10-18 20:03
我發現 IRRemote Library 有兩個版本