My_Repo_from160937/servo_motor/index.html
2023-05-25 20:35:08 +03:00

32 lines
954 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome file</title>
<link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>
<body class="stackedit">
<div class="stackedit__html"><h1 id="считывание-данных">Считывание данных</h1>
<h3 id="значение-ножки">Значение ножки</h3>
<p id="pin">123</p>
<h3 id="потенциометр">Потенциометр</h3>
<p id="pot">123</p>
</div>
<script>
setInterval(() => {
Promise.all([
fetch('/pin').then((response) => response.json()),
fetch('/potonciometer').then((response) => response.json())
]).then(([pin, pot]) => {
document.getElementById('pin').innerHTML = pin + '\n'
document.getElementById('pot').innerHTML = pot;
})
}, 300);
</script>
</body>
</html>