Skip to content

Commit ba4fc63

Browse files
committed
essential changes to serialport setup for 01-button-serial
1 parent 842efd8 commit ba4fc63

File tree

3 files changed

+5
-2828
lines changed

3 files changed

+5
-2828
lines changed

day2/01-button-serial/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Upload 01-button-serial.ino to Arduino board!
33
// --------------------------------------------------------
44

5-
const SerialPort = require('serialport');
6-
const Readline = require('@serialport/parser-readline');
7-
const sPort = new SerialPort('/dev/cu.usbmodem141101', { baudRate: 9600 });
8-
const parser = sPort.pipe(new Readline({ delimiter: '\n' }));
5+
const { SerialPort } = require('serialport');
6+
const { ReadlineParser } = require('@serialport/parser-readline');
7+
const sPort = new SerialPort({ path: '/dev/cu.usbmodem14101', baudRate: 9600 });
8+
const parser = sPort.pipe(new ReadlineParser({ delimiter: '\r\n' }));
99

1010

1111
// --------------------------------------------------------

0 commit comments

Comments
 (0)