mercredi 22 avril 2015

html source code from Arduino

I am making a home appliance control device using arduino. I got this html code from the website. What is the code to get the value from the Arduino? I think

$("#temperatureDisplay").load('temperature_display.php');

This part would be a receiving the value from the Arduino, but I am confusing. If I know what is code for receiving the value, how can I use if statement to change the background color with different value of output from Arduino?

<!DOCTYPE html>
<html>
<head>
    <script src="jquery-2.0.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>Weather Station</title>
</head>

<body>
<div class="data">
    <div class="dataTitle">Temperature: </div>
    <div id="temperatureDisplay">Waiting for data ...</div>
</div>

<script type="text/javascript">

    setInterval(function() 
{
    $("#temperatureDisplay").load('temperature_display.php');
}, 1000);

</script>


</body>

</html>

Aucun commentaire:

Enregistrer un commentaire