/*************************************************************Project: Temperature ControllerAuthor: Agustin Marmolejo (Twitter @eljamz)Date: 18-December-2012Description: A temperature controller who save's all the data into MySQLand from there it can activate some relays.*************************************************************/#include <Ethernet.h>#include <SPI.h>#include <OneWire.h>

//void loopvoid loop(void) { float temperature = getTemp(); // Get the temperature from sensor and INSERT to MySQL. Serial.println(temperature); // print out temperature. delay(500); //just here to slow down the output so it is easier to read String pageValue = connectAndRead(); //Connect to server and get action to follow!. Serial.println(pageValue); //print out the findings. delay(500); //just here to slow down the output so it is easier to read}

/*FUNCTION FOR RELAYS*/String connectAndRead(){ //connect to the server