|
|
@ -10,7 +10,6 @@ var port = 8000;
|
|
|
|
const { SerialPort } = require('serialport')
|
|
|
|
const { SerialPort } = require('serialport')
|
|
|
|
const { ReadlineParser } = require('@serialport/parser-readline')
|
|
|
|
const { ReadlineParser } = require('@serialport/parser-readline')
|
|
|
|
const sport = new SerialPort({ path: '/dev/ttyACM0', baudRate: 115200 })
|
|
|
|
const sport = new SerialPort({ path: '/dev/ttyACM0', baudRate: 115200 })
|
|
|
|
|
|
|
|
|
|
|
|
const parser = sport.pipe(new ReadlineParser({ delimiter: '\r\n' }))
|
|
|
|
const parser = sport.pipe(new ReadlineParser({ delimiter: '\r\n' }))
|
|
|
|
parser.on('data', console.log)
|
|
|
|
parser.on('data', console.log)
|
|
|
|
|
|
|
|
|
|
|
|