View mqtt_send_digital.ino
/* | |
This example connects to a WPA encrypted WiFi network, | |
using the WiFi Shield 101. | |
Then connects to the Arduino Cloud MQTT broker using | |
SSL, and sends updates on the status of an LED which | |
is controlled by a button. | |
Circuit: | |
* WiFi shield attached |
View uri-beacon-test.js
var UriBeacon = require('./uri-beacon'); | |
UriBeacon.on('discover', function(uriBeacon) { | |
console.log('discovered: ' + JSON.stringify(uriBeacon, null, 2)); | |
}); | |
UriBeacon.startScanning(); |
View led_callback_nRF51822_low_power.ino
// Import libraries (BLEPeripheral depends on SPI) | |
#include <SPI.h> | |
#include <BLEPeripheral.h> | |
// define pins (varies per shield/board) | |
#define BLE_REQ 10 | |
#define BLE_RDY 2 | |
#define BLE_RST 9 | |
// LED pin |
View BLEPeripheral_NeoPixel.ino
// Import libraries (BLEPeripheral depends on SPI) | |
#include <SPI.h> | |
#include <BLEPeripheral.h> | |
#include <Adafruit_NeoPixel.h> | |
// define pins (varies per shield/board) | |
#define BLE_REQ 10 | |
#define BLE_RDY 2 | |
#define BLE_RST 9 |
View mwc-challenge-2014.js
var bleno = require('bleno'); | |
var uuid = 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'.replace(/-/g, ''); | |
var major = 21047; | |
var minorStart = 0; | |
var minorEnd = 5; | |
var measuredPower = -59; | |
console.log("MWC Scavenger Hunt"); |
View yun.js
var util = require('util'); | |
var bleno = require('bleno'); | |
var five = require("johnny-five"); | |
var BlenoPrimaryService = bleno.PrimaryService; | |
var BlenoCharacteristic = bleno.Characteristic; | |
var BlenoDescriptor = bleno.Descriptor; | |
var board = new five.Board({ |
View advertisement-discovery.js
var noble = require('noble'); | |
noble.on('stateChange', function(state) { | |
if (state === 'poweredOn') { | |
noble.startScanning(); | |
} else { | |
noble.stopScanning(); | |
} | |
}); |
View humidity.js
var SensorTag = require('sensortag'); | |
SensorTag.discover(function(sensorTag) { | |
console.log('discover'); | |
sensorTag.connect(function() { | |
console.log('connect'); | |
sensorTag.discoverServices(function() { | |
console.log('discoverServices'); | |
sensorTag.discoverCharacteristics(function() { | |
console.log('discoverCharacteristics'); |
View output.txt
{ name: '/', | |
service: | |
{ name: 'org.bluez', | |
bus: | |
{ connection: [Object], | |
serial: 2, | |
cookies: [Object], | |
methodCallHandlers: {}, | |
signals: [Object], | |
exportedObjects: {}, |
View gist:5288912
var noble = require('noble'); | |
var main = function() { | |
noble.on('stateChange', function(state) { | |
console.log('stateChange: ' + state); | |
if (state === 'poweredOn') noble.startScanning(); else noble.stopScanning(); | |
}); | |
noble.on('peripheralDiscover', function(peripheral) { |