Skip to content

Instantly share code, notes, and snippets.

View odbol's full-sized avatar

Tyler Freeman odbol

View GitHub Profile
@odbol
odbol / gist:11274002
Created April 25, 2014 00:20
Test Updating Firmware on the BCM20732S via HCI UART
/**
BCM20732S HCI UART is connected to Serial RX/TX pins on the Arduino Due.
BCM20732S Reset pin is connected to BLE_RESET_PIN
**/
#include <Arduino.h>
#define BLE_RESET_PIN 31
@odbol
odbol / gist:11194196
Created April 22, 2014 21:02
Parse hex string and redisplay as base 10 and character equivalents.
var str = "90036F4920203080030049202030",
res = [];
for (var i = 0; i < str.length; i += 2) {
var hex = str.substr(i, 2),
num = parseInt(hex, 16),
char = String.fromCharCode(num)
pr = hex + "\t" + num + "\t" + char + "\n";
res.push(pr);