I need to convert my serial monitor readings to html page

I have a code which is for dectecting if the voltge decrease or not.

int fault3= 13;
int fault3_sensor= A0;

void setup() {
Serial.begin(9600);

pinMode(fault3, OUTPUT);

}

void loop() {

Serial.println(analogRead(fault3_sensor));

if (analogRead(fault3_sensor)>900)
{digitalWrite(fault3, HIGH);
Serial.print("Fault3 Detected");
delay(5000);
}

else{
digitalWrite(fault3, LOW);
Serial.print("NO fault3");
}
delay(100);}

I used LDR.

  • When there is light, the serial monitor gives me "No fault".
  • When there is NO light, the serial monitor gives me "Fault3 Detected".

Eeverything working fine.
But I would like the code to work in the html page (instead of only in the serial monitor).

Thank you

You can either get a ethernet or wifi shield and setup a webserver in the arduino. Or you can make a local page on the pc which involves js or java applet that does the serial communication.

thank you for replying

I have Ethernet shield.

But I want the values that shown in the serial monitor is to be shown in html page (instead of serial monitor).

But I want the values that shown in the serial monitor is to be shown in html page (instead of serial monitor).

So, what is the problem? Change Serial.print() to client.print() and the data goes to the client instead of the Serial Monitor.

Embedding the data between html tags is not rocket science.

client.print("<h2>");
client.print("Your data goes here");
client.print("</h2>");

Thank you for the great help