MEDIATEK LinkIt Smart 7688 Developer's Manual page 65

Hide thumbs Also See for LinkIt Smart 7688:
Table of Contents

Advertisement

npm init
After about 10 seconds, you'll be prompted to enter several inputs such as a name for app, version
and description etc. as shown in Figure 43. This is a set up process for the node application. For
this tutorial, press enter for all questions.
root@myLinkIt:~/app#
In the
8)
following command.
vim app.js
Press i to insert the below codes in the editor. For example:
9)
var m = require('mraa');
var ledState = true;
var myLed = new m.Gpio(44); // GPIO44 is the Wi-Fi LED
myLed.dir(m.DIR_OUT);
function periodicActivity() {
myLed.write(ledState ? 1 : 0);
ledState = !ledState;
setTimeout(periodicActivity, 1000);
}
periodicActivity();
Press :wq! to save the
10)
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.
MediaTek LinkIt™ Smart 7688 Developer's Guide
Figure 43 Set up the Node.js application prompt
prompt, create a file named app.js by entering the
app.js
file.
© 2015, 2016 MediaTek Inc.
Page 65

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents