#include <SPI.h>
#include <Ethernet.h>
byte mac[]= { 0x00, 0xE0, 0x4C, 0x60, 0x1A, 0x92};
// 00:E0:4C:60:1A:92
IPAddress ip(192,168,2,105);
EthernetServer server(80);
int seg =0, seg2 =0, min= 0;
void setup()
{
Ethernet.begin(mac, ip);
server.begin();
Serial.begin(9600);
}
void loop()
{
EthernetClient client = server.available();
if (client)
{
boolean currentLineIsBlank = true;
while (client.connected())
{
if (client.available())
{
char c = client.read();
if (c == '\n' && currentLineIsBlank)
{
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println();
client.println("<!DOCTYPE html>");
client.println("<html>");
client.println("<head>");
client.println("<title>Servidor Web VDS</title>");
client.println("</head>");
client.println("<body>");
temporizador(client);
client.println("<h1>Meu primeiro Servidor Web</h1>");
client.println("<p>Esperamos que voce tenha gostado deste tutorial</p>");
client.println("</body>");
client.println("</html>");
break;
}

if (c == '\n')
{
currentLineIsBlank = true;
}
else if (c != '\r')
{
currentLineIsBlank = false;
}
}
}
delay(1);
client.stop();
}
}
void temporizador(EthernetClient cl){
static unsigned long ult_tempo = 0;
int tempo = millis();
if((tempo - ult_tempo) >= 1000){
ult_tempo = tempo;
seg++; seg2++;
}
if(seg >= 60){
seg =0;
seg2 =0;
min++;
};
cl.println("Tempo: ");
cl.println(min);
cl.println(" : ");
cl.println(seg2);
cl.println(" : ");
cl.println(millis());
}