This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/_Dashboard/app/renderer/serial/index.js

10 lines
259 B
JavaScript

import SerialPort from 'serialport';
const Readline = require('@serialport/parser-readline');
const port = new SerialPort('COM6', {
baudRate: 9600,
});
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
const initialState = { port, parser };