diff --git a/garage/Garage_Nano.ino b/garage/Garage_Nano.ino index f6e2201..4d1a96b 100644 --- a/garage/Garage_Nano.ino +++ b/garage/Garage_Nano.ino @@ -63,6 +63,9 @@ void loop() { while (client.connected()) { if (client.available()) { char c = client.read(); + + // TODO extract GET URI + Serial.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, @@ -70,22 +73,10 @@ void loop() { if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); - client.println("Content-Type: text/html"); + client.println("Content-Type: text/plain"); client.println("Connection: close"); // the connection will be closed after completion of the response - client.println("Refresh: 5"); // refresh the page automatically every 5 sec client.println(); - client.println(""); - client.println(""); - // output the value of each analog input pin - for (int analogChannel = 0; analogChannel < 6; analogChannel++) { - int sensorReading = analogRead(analogChannel); - client.print("analog input "); - client.print(analogChannel); - client.print(" is "); - client.print(sensorReading); - client.println("
"); - } - client.println(""); + client.println("Mufflon!"); break; } if (c == '\n') { @@ -130,4 +121,3 @@ void triggerAll() { digitalWrite(motorPin, LOW); digitalWrite(ledPin, HIGH); } -