made booleanaray a public variable
This commit is contained in:
@@ -2,7 +2,7 @@ let port;
|
|||||||
let reader;
|
let reader;
|
||||||
const decoder = new TextDecoder("utf-8");
|
const decoder = new TextDecoder("utf-8");
|
||||||
let readibleoutput = 0;
|
let readibleoutput = 0;
|
||||||
|
let booleanArray = [];
|
||||||
// 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
|
||||||
@@ -40,7 +40,7 @@ async function readLoop() {
|
|||||||
if (Array.isArray(SerialArray)) {
|
if (Array.isArray(SerialArray)) {
|
||||||
//Convert the array of strings to a boolean array
|
//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
|
//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);
|
console.log(booleanArray);
|
||||||
} else {
|
} else {
|
||||||
console.error("Dit is geen Array");
|
console.error("Dit is geen Array");
|
||||||
|
Reference in New Issue
Block a user