This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tessel = require('tessel'); | |
| var blePort = tessel.port['A']; | |
| var bleLib = require('ble-ble113a'); | |
| var data = new Buffer('0201061aff4c000215e2c56db5dffb48d2b060d0f5a71096e000000000c6','hex'); | |
| var ble = bleLib.use(blePort, function(err) { | |
| if (err) return console.log("Error connecting to slave", err); | |
| ble.setAdvertisingData(data, function (e2){ | |
| if (e2) console.log("Error set adv", e2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tessel = require('tessel'); | |
| var https = require('https'); | |
| var querystring = require('querystring'); | |
| // Build the post string from an object | |
| var post_data = querystring.stringify({ | |
| 'accel-x' : '1.24353', | |
| 'accel-y': '-.543653', | |
| 'accel-z': '0.021234', | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| function parseIntelHexData(path, callback) { | |
| var hex = fs.readFileSync(path).toString(); | |
| console.log('loaded file'); | |
| // Split the file into lines | |
| var hexLines = hex.split('\n'); | |
| // The last line is an empty string | |
| hexLines.pop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tessel = require('tessel'); | |
| var blePort = tessel.port('a'); | |
| var bleDriver = require('../'); | |
| bluetooth = bleDriver.use(blePort, function(err) { | |
| if (err) { | |
| return console.log("Failed to connect"); | |
| } | |
| else { | |
| // Connect to moosh |
NewerOlder