This commit is contained in:
sam
2023-10-31 13:35:44 +01:00
parent c06dbff39b
commit 76ab9ac30e

View File

@@ -10,21 +10,16 @@ let xArray = [];
let tempArray = []; let tempArray = [];
let humidArray = []; let humidArray = [];
let lichtArray = []; let lichtArray = [];
let humid = 0;
let licht = 0;
let TempAdvies; let TempAdvies;
let HumidAdvies; let HumidAdvies;
let LichtAdvies; let LichtAdvies;
let VolledigAdvies; let VolledigAdvies;
let Soort;
let Waardes;
let TempWaardes; let TempWaardes;
let LuchtVochtigsheidWaardes; let LuchtVochtigsheidWaardes;
let LichtWaardes; let LichtWaardes;
const between = (x, min, max) => { const between = (x, min, max) => {
return x >= min && x <= max; return x >= min && x <= max;
}; };
const updatehtml = (div, variable)
// Request a port and open a connection. // Request a port and open a connection.
async function connect() { async function connect() {
//vraag aan de browser om een serial port te selecteren //vraag aan de browser om een serial port te selecteren
@@ -71,8 +66,6 @@ async function readLoop() {
humidArray.push(SensorValues[1]) humidArray.push(SensorValues[1])
lichtArray.push(SensorValues[2]) lichtArray.push(SensorValues[2])
} }
buffer = []; buffer = [];
@@ -88,10 +81,7 @@ async function readLoop() {
plotly(humidGraph, humidArray) plotly(humidGraph, humidArray)
plotly(lightGraph, lichtArray) plotly(lightGraph, lichtArray)
Advies(SensorValues[0], SensorValues[1], SensorValues[2]) Advies(SensorValues[0], SensorValues[1], SensorValues[2])
AdviesUpdate() AdviesUpdate()
} }
// Show the received data in the console // Show the received data in the console
@@ -103,7 +93,6 @@ async function readLoop() {
break; break;
} }
} }
} }
} }