From 2b49b0893122b12c1e0fc94bed0498b6eabdbe8e Mon Sep 17 00:00:00 2001 From: louisa Date: Sun, 4 Jun 2023 15:50:18 +0200 Subject: [PATCH] test --- app.js | 1 - public/index.html | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 0aa5ff5..1b3bb34 100644 --- a/app.js +++ b/app.js @@ -10,7 +10,6 @@ var port = 8000; const { SerialPort } = require('serialport') const { ReadlineParser } = require('@serialport/parser-readline') const sport = new SerialPort({ path: '/dev/ttyACM0', baudRate: 115200 }) - const parser = sport.pipe(new ReadlineParser({ delimiter: '\r\n' })) parser.on('data', console.log) diff --git a/public/index.html b/public/index.html index ffa2e8e..a9782f1 100644 --- a/public/index.html +++ b/public/index.html @@ -18,11 +18,9 @@ // Split the data into separate parts const [node, value] = data.split(' '); - - if (node === 'node4' && value === '21') { - // Change the background color to red - document.body.style.backgroundColor = 'red'; - } else { + if (node === 'node3' && value === '15'){ + document.body.style.backgroundColor = 'red';} + else { // Restore the default background color document.body.style.backgroundColor = 'white'; }