Skip to content

Instantly share code, notes, and snippets.

View don's full-sized avatar

Don Coleman don

View GitHub Profile
@don
don / gist:6772141
Last active December 24, 2015 08:39
Install nodejs on BeagleBone Black
<1> download node
<2> install it in +/usr/local+
<3> make symlinks (aliases) to node and npm so you can call them from the command line easily.
$ cd ~/downloads
$ curl -O http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz <1>
$ cd /usr/local
$ sudo tar xzf ~/downloads/node-v0.10.12-linux-arm-pi.tar.gz <2>
$ cd bin
$ sudo ln -s ../node-v0.10.12-linux-arm-pi/bin/node <3>
@don
don / ArduinoNFC.ino
Last active December 23, 2015 16:59
Arduino sketch for NY Maker Faire 2013 http://makerfaire.com/makers/arduino-nfc/
/*
Seeed Studio (or Adafruit) NFC Shield
Adafruit 60 LED NeoPixel Strip
Arduino Uno
NFC tag should be TNF MIME_MEDIA and Type text/led
Payload should have RGB color as 0,0,255
*/
#if 1
@don
don / ndef_push.ino
Last active December 19, 2015 06:39
/**
* P2P NDEF Push
* requires http://www.seeedstudio.com/depot/nfc-shield-v20-p-1370.html
* and https://github.com/Seeed-Shield/NFC_Shield_DEV
* simplified example based on examples/nfc_ndef_push_url
*/
#include <PN532.h>
#include <NFCLinkLayer.h>
#include <SNEP.h>
#include <NdefMessage.h>
@don
don / gen_keywords.pl
Last active May 7, 2018 14:25
@bjepson keyword.txt generation script for Arduino libraries
#!/usr/bin/perl -w
# Run this from the Arduino library directory to generate keywords.txt
# Optionally pass the name of the library as the first argument
# $ gen_keywords.pl Foo > keywords.txt
use strict;
my $in_public = 0;
@don
don / Arduino_NFC_LED_Demo
Last active December 17, 2015 23:39
Arduino NFC Demo from Maker Faire Bay Area 2013 http://don.github.io/slides/2013-05-18-arduino-nfc
#include <Wire.h>
#include <Adafruit_NFCShield_I2C.h>
#include <NfcAdapter.h>
NfcAdapter nfc = NfcAdapter();
#include <Adafruit_NeoPixel.h>
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
@don
don / 0_connect.ino
Last active December 17, 2015 12:09
var macAddress = "00:00:AA:BB:CC:DD";
var connected = function() {
// connected, do something
};
var disconnected = funtion(error) {
// disconnected
};
bluetoothSerial.connect(macAddress, connected, disconnected);
@don
don / 01_install.sh
Last active December 17, 2015 10:48
Code for NFC slides - Maker Faire Bay Area 2013
cd ~/Documents/Arduino/libraries
git clone git@github.com:adafruit/Adafruit_NFCShield_I2C.git
git clone git@github.com:don/Ndef.git
@don
don / phoengap-nfc-issue-80.js
Last active December 17, 2015 03:29
phonegap-nfc - write a message to unformatted tags, read text message from NDEF tags
// handle unformatted tags
nfc.addNdefFormatableListener(
function (nfcEvent) {
// NDEF message with one record
var message = [
ndef.textRecord("hello, world")
];
nfc.write(
@don
don / HelloNDEFWorld.ino
Created January 15, 2013 03:10
Write hello world NDEF message. Cheat by hardcoding bytes.
//
// Write "Hello, world!" in a plain text NDEF message
// Tag must be a Mifare Classic with a 4 byte ID
// Tested with Samsung TecTile
//
#include <Wire.h>
#include <Adafruit_NFCShield_I2C.h>
#define IRQ (2)
#define RESET (3) // Not connected by default on the NFC Shield
@don
don / .gitignore
Created February 11, 2012 19:48
Git Ignore for Windows Phone Projects
*.bak
thumbs.db
App_Data/
bin/
obj/
Bin/
_ReSharper.*/
tmp/