From 3cc4f93153ac6d7faca8113bff5265935b15f4a6 Mon Sep 17 00:00:00 2001 From: Firdaus Hakimi Date: Wed, 15 May 2024 10:01:08 +0800 Subject: [PATCH] eh --- raw-arduino-data/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/raw-arduino-data/index.js b/raw-arduino-data/index.js index 16405fc..8e03fee 100644 --- a/raw-arduino-data/index.js +++ b/raw-arduino-data/index.js @@ -1,8 +1,4 @@ -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)) -} - -while (true) { +function updateRandVal() { let randVal1 = Math.random(); let randVal2 = Math.random(); let randVal3 = Math.random(); @@ -14,3 +10,5 @@ while (true) { document.getElementById("seabed").innerText = 100 + randVal4 + randVal5 + randVal6; } + +setInterval(updateRandVal, 1000);