Add radar/index.php
This commit is contained in:
23
radar/index.php
Normal file
23
radar/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ESP32 Radar</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ultrasone afstand</h1>
|
||||
<div id="afstand">Laden...</div>
|
||||
|
||||
<script>
|
||||
function updateAfstand() {
|
||||
fetch('afstand.txt') // leest de laatste waarde
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
document.getElementById('afstand').innerText = data + " cm";
|
||||
});
|
||||
}
|
||||
setInterval(updateAfstand, 1000); // elke seconde vernieuwen
|
||||
updateAfstand();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user