MediaTek LinkIt™ Smart 7688 Developer's Guide
© 2015, 2016 MediaTek Inc.
Page 85
This document contains information that is proprietary to MediaTek Inc.
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited.
7)
Remove node-serial port by typing the following command.
$ rm –rf ./node_modules/firmata/node_modules/serialport
Firmata has a built in node-serial port and when you installed Firmata, it creates a compile file on
your computer. However, this compile file needs to be removed because it’s already built in LinkIt
Smart 7688.
8)
Compress the Firmata folder
$ tar –cvf ./firmata.tar ./node_modules/firmata
9)
Use scp to transfer the compressed file to LinkIt Smart 7688 Duo
$ scp ./firmata.tar [email protected]:/root/app/node_modules
10)
Open the LinkIt Smart 7688 Duo SSH system console and type the following commands to
create a directory called app and go to that directory.
$ mkdir app && cd app
11)
Create a file called app.js
$ vim app.js
12)
Type
i
to insert the following example code:
console.log('WWW blink start ...');
var ledPin = 13;
var firmata = require('firmata');
var board = new firmata.Board("/dev/ttyS0",function(err) {
if (err) {
console.log(err);
board.reset();
return;
}
console.log('connected...');