made booleanaray a public variable
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user