added importing and exporting varaibles

This commit is contained in:
sam
2023-11-24 12:00:46 +01:00
parent c23d29c72d
commit 1c1506a217
2 changed files with 2 additions and 1 deletions

View File

@@ -41,7 +41,6 @@ async function readLoop() {
//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');
console.log(booleanArray);
} else {
console.error("Dit is geen Array");
@@ -61,6 +60,7 @@ async function readLoop() {
}
}
export {booleanArray};
// Sluit de poort
async function disconnect() {

View File

@@ -1,5 +1,6 @@
let Playerposx = 500;
let Playerposy = 300;
import {booleanArray} from './Serial.js';
if (booleanArray) {
if (booleanArray[1]) {