mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
12 lines
324 B
JavaScript
12 lines
324 B
JavaScript
'use strict';
|
|
|
|
// Constructor callback example
|
|
const SerialPort = require('serialport');
|
|
const port = new SerialPort('/dev/tty-usbserial1', () => {
|
|
console.log('Port Opened');
|
|
});
|
|
|
|
port.write('main screen turn on', (err) => {
|
|
if (err) { return console.log('Error: ', err.message) }
|
|
console.log('message written');
|
|
});
|