We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 842efd8 commit ba4fc63Copy full SHA for ba4fc63
day2/01-button-serial/index.js
@@ -2,10 +2,10 @@
2
// Upload 01-button-serial.ino to Arduino board!
3
// --------------------------------------------------------
4
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' }));
+const { SerialPort } = require('serialport');
+const { ReadlineParser } = require('@serialport/parser-readline');
+const sPort = new SerialPort({ path: '/dev/cu.usbmodem14101', baudRate: 9600 });
+const parser = sPort.pipe(new ReadlineParser({ delimiter: '\r\n' }));
9
10
11
0 commit comments