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