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
import time | |
from machine import Pin | |
led = Pin(25, Pin.OUT) | |
MORSE = { | |
'A': [ '.', '-' ], | |
'B': [ '-', '.', '.', '.' ], | |
'C': [ '-', '.', '-', '.' ], |
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
/* | |
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 |
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 UriBeacon = require('./uri-beacon'); | |
UriBeacon.on('discover', function(uriBeacon) { | |
console.log('discovered: ' + JSON.stringify(uriBeacon, null, 2)); | |
}); | |
UriBeacon.startScanning(); |
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
// 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 |
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
// 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 |
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 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"); |
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 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({ |
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 noble = require('noble'); | |
noble.on('stateChange', function(state) { | |
if (state === 'poweredOn') { | |
noble.startScanning(); | |
} else { | |
noble.stopScanning(); | |
} | |
}); |
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 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'); |
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
{ name: '/', | |
service: | |
{ name: 'org.bluez', | |
bus: | |
{ connection: [Object], | |
serial: 2, | |
cookies: [Object], | |
methodCallHandlers: {}, | |
signals: [Object], | |
exportedObjects: {}, |
NewerOlder