Skip to content

Instantly share code, notes, and snippets.

Don Coleman don

Block or report user

Report or block don

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
don / MacAddress.ino
Last active Feb 20, 2019
Get the MAC address for an Arduino MRK board
View MacAddress.ino
// Print the WiFi firmware version and MAC address for MRK boards
// Based on
// and
#include <SPI.h>
#include <WiFi101.h>
#define WIFI_LIB "WiFi101"
#include <WiFiNINA.h>
don / index-autoconnect.js
Last active Jun 9, 2018
Cordova - automatically connect to a Bluetooth device by name
View index-autoconnect.js
var app = {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
onDeviceReady: function() {
// Auto connect whenever the device is in range
const MAC_ADDRESS = 'E4:86:1E:4E:5A:FB';
ble.autoConnect(MAC_ADDRESS, app.onConnected, app.onDisconnected);
don / hexStringToArrayBuffer.js
Created May 3, 2018
Convert hex string to ArrayBuffer
View hexStringToArrayBuffer.js
* Convert a hex string to an ArrayBuffer.
* @param {string} hexString - hex representation of bytes
* @return {ArrayBuffer} - The bytes in an ArrayBuffer.
function hexStringToArrayBuffer(hexString) {
// remove the leading 0x
hexString = hexString.replace(/^0x/, '');
don / index.html
Created Apr 13, 2018
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>NFC Reader</title>
View BroadcastCount_v2.ino
// Broadcast Characteristic Value
// Simple counter that broadcasts a value
// Use v2 of CurieBLE library
#include <CurieBLE.h> // Arduino 101
uint8_t value = 0;
unsigned long previousMillis = 0; // will store last time counter was updated
unsigned short interval = 1000; // interval at which to update counter (milliseconds)
don / index.js
Created Jan 16, 2018
Break up large ArrayBuffer before writing to BLE characteristic
View index.js
// Mock BLE so you can run example from nodejs
const ble = {
write: function(device_id, service, characteristic, buffer, success, failure) {
// log to console instead of writing
console.log('>>', new Uint8Array(buffer));
// always call success callback
View filter.js
if ( !== '5F5D6C62-1414-4657-3ECA-3B34E124CE60') { // Android AA:BB:CC:DD:EE:FF
console.log('skipping ' +;
don /
Created Oct 4, 2017
Software Install instructions for the PhoneGap Day NY 2017 - Hands on Bluetooth LE Workshop

Hands-on Bluetooth Low Energy

PhoneGap Day NY - October 12th, 2017

Software Installation

In order to get the most of the class, we're asking everyone to install the software before the workshop.

It's important that you follow this guide and have you computer setup before you arrive. We want to spend time learning about Bluetooth not installing software.


View eddystone.ino
#include <SPI.h>
#include <EddystoneBeacon.h>
EddystoneBeacon eddystoneBeacon = EddystoneBeacon();
void setup() {
// power, URI
eddystoneBeacon.begin(-18, "");
View midi-ble-peripheral.js
var midiService = {
characteristics: [
properties: property.WRITE | property.READ | property.NOTIFY,
permissions: permission.WRITEABLE | permission.READABLE,
descriptors: [
uuid: '2901',
You can’t perform that action at this time.