added importing and exporting varaibles
This commit is contained in:
@@ -41,7 +41,6 @@ async function readLoop() {
|
|||||||
//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');
|
let 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");
|
||||||
@@ -61,6 +60,7 @@ async function readLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
export {booleanArray};
|
||||||
|
|
||||||
// Sluit de poort
|
// Sluit de poort
|
||||||
async function disconnect() {
|
async function disconnect() {
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
let Playerposx = 500;
|
let Playerposx = 500;
|
||||||
let Playerposy = 300;
|
let Playerposy = 300;
|
||||||
|
import {booleanArray} from './Serial.js';
|
||||||
|
|
||||||
if (booleanArray) {
|
if (booleanArray) {
|
||||||
if (booleanArray[1]) {
|
if (booleanArray[1]) {
|
||||||
|
Reference in New Issue
Block a user