node-serialport-bindings-cpp/examples/open-callback.js
Francis Gulotta c40c24972a Reorganize files for clarity
- Move Parsers into a directory
- Move Bindings into a directory
- Add a linter for require calls
2017-01-07 00:23:20 -05:00

13 lines
372 B
JavaScript

/* eslint-disable require-path-exists/exists */
'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');
});