MEDIATEK LinkIt Smart 7688 Developer's Manual page 86

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

Advertisement

console.log('board.firmware: ', board.firmware);
board.pinMode(ledPin, board.MODES.OUTPUT);
var url = require('url');
var http = require('http');
http.createServer(function(request, response) {
var params = url.parse(request.url, true).query;
if (params.value.toLowerCase() == 'high') {
} else {
}
response.writeHead(200);
response.write("The value written was: " + params.value);
response.end();
}.bind(this)).listen(8080);
console.log('Listening on port 8080 ...');
});
Type :wq! to save and exit the editor.
13)
Run the node.js example by typing the following command in the system console:
14)
# node app
Open a browser and enter the following commands to control the LED:
15)
a) To turn LED ON: mylinkit.local:8080?value=high
b) To turn LED OFF: mylinkit.local:8080?value=low
The D13 LED on LinkIt Smart 7688 Duo should blink according to your command of choice.
16)
6.6.7.
Cylon.js example
This section illustrates the MPU and MCU communication using Firmata in Cylon.js programming
language. The steps are:
Set up the MCU, start by launching Arduino IDE 1.6.5 on your computer.
1)
Copy the Firmata example, you do this by opening a browser and click here. You'll see a
2)
Firmata example code. Click on Raw button to copy the code, similar to Figure 54.
Set up the MPU, for this you'll need to install Firmata and four Cylon modules (cylon,
3)
cylon-firmata, cylon-gpio and cylon-i2c) on your computer. The Cylon modules are
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.
board.digitalWrite(ledPin, board.HIGH);
board.digitalWrite(ledPin, board.LOW);
© 2015, 2016 MediaTek Inc.
MediaTek LinkIt™ Smart 7688 Developer's Guide
Page 86

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents