removed junk
This commit is contained in:
@@ -6,7 +6,6 @@ let port;
|
||||
let reader;
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
let readibleoutput = 0;
|
||||
let xArray = [];
|
||||
let tempArray = [];
|
||||
let humidArray = [];
|
||||
let lichtArray = [];
|
||||
@@ -17,9 +16,11 @@ let VolledigAdvies;
|
||||
let TempWaardes;
|
||||
let LuchtVochtigsheidWaardes;
|
||||
let LichtWaardes;
|
||||
// Maakt het makkelijk om een if "true" te maken als een variabel zich tussen 2 waardes bevind
|
||||
const between = (x, min, max) => {
|
||||
return x >= min && x <= max;
|
||||
};
|
||||
|
||||
// Request a port and open a connection.
|
||||
async function connect() {
|
||||
//vraag aan de browser om een serial port te selecteren
|
||||
@@ -30,7 +31,7 @@ async function connect() {
|
||||
readLoop()
|
||||
}
|
||||
|
||||
// Read data
|
||||
// Read data from serial port
|
||||
async function readLoop() {
|
||||
let buffer = [];
|
||||
|
||||
@@ -59,6 +60,7 @@ async function readLoop() {
|
||||
}
|
||||
|
||||
if (SensorValues) {
|
||||
// Show the received data in the console
|
||||
console.log(SensorValues)
|
||||
|
||||
//zet alle data in een array
|
||||
@@ -83,9 +85,6 @@ async function readLoop() {
|
||||
Advies(SensorValues[0], SensorValues[1], SensorValues[2])
|
||||
AdviesUpdate()
|
||||
}
|
||||
|
||||
// Show the received data in the console
|
||||
|
||||
// Exit the loop when done
|
||||
if (done) {
|
||||
console.log('[readLoop] DONE', done);
|
||||
@@ -112,7 +111,6 @@ function plotly(graph, dataArray) {
|
||||
}
|
||||
|
||||
//eigen library maken voor serial
|
||||
|
||||
function Advies(TempWaardes, LuchtVochtigsheidWaardes, LichtWaardes) {
|
||||
|
||||
if (TempWaardes < 0) {
|
||||
@@ -146,11 +144,8 @@ function Advies(TempWaardes, LuchtVochtigsheidWaardes, LichtWaardes) {
|
||||
if (LichtWaardes == 0 < 400) {
|
||||
LichtAdvies = "Zet het licht aan holbewoner."
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function AdviesUpdate(){
|
||||
VolledigAdvies = TempAdvies + HumidAdvies + LichtAdvies;
|
||||
document.getElementById("Advies").innerHTML = VolledigAdvies;
|
||||
|
Reference in New Issue
Block a user