made booleanaray a public variable

This commit is contained in:
sam
2023-11-24 12:32:35 +01:00
parent 7d3452b88b
commit e9008e8a31

View File

@@ -2,7 +2,7 @@ let port;
let reader;
const decoder = new TextDecoder("utf-8");
let readibleoutput = 0;
let booleanArray = [];
// Request a port and open a connection.
async function connect() {
//vraag aan de browser om een serial port te selecteren
@@ -40,7 +40,7 @@ async function readLoop() {
if (Array.isArray(SerialArray)) {
//Convert the array of strings to a boolean array
//When a bit is 1 it becomes true, when a bit is 0 it becomes false
let booleanArray = SerialArray.map(bit => bit == '1');
booleanArray = SerialArray.map(bit => bit == '1');
console.log(booleanArray);
} else {
console.error("Dit is geen Array");