added json parsing
This commit is contained in:
@@ -4,7 +4,7 @@ let reader;
|
||||
let decoder = new TextDecoder("utf-8");
|
||||
let counterElement = document.getElementById("counter");
|
||||
let readibleoutput = 0;
|
||||
let temp = 0;
|
||||
let tempArray = [];
|
||||
let humid = 0;
|
||||
let licht = 0;
|
||||
|
||||
@@ -47,8 +47,10 @@ async function readLoop() {
|
||||
|
||||
if (SensorValues) {
|
||||
console.log(SensorValues)
|
||||
|
||||
tempArray.push(SensorValues[0])
|
||||
}
|
||||
console.log(sensorString);
|
||||
|
||||
buffer = [];
|
||||
// var array = sensorString.split(','),
|
||||
// temp = array[0], humid = array[1], licht = array[2];
|
||||
@@ -74,8 +76,6 @@ async function readLoop() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Close the port
|
||||
async function disconnect() {
|
||||
await reader.cancel();
|
||||
|
Reference in New Issue
Block a user