This file contains 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
#!/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; |
This file contains 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
/** | |
* 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> |
This file contains 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
/* | |
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 |
This file contains 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
<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> |
This file contains 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
<script type="text/javascript"> | |
window.console = { | |
log: function (str) { window.external.Notify(str); } | |
}; | |
// output errors to console log | |
window.onerror = function (e) { | |
console.log("window.onerror ::" + JSON.stringify(e)); | |
}; |
This file contains 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
// Send Ninja Block Device info to The Thing System via TSRP | |
// | |
// This script polls the ninja cloud to fetch device information | |
// | |
// $ node ninja-thing.js | |
// | |
// (c) 2013 Don Coleman | |
/* jshint unused: vars, camelcase: false */ | |
'use strict'; |
This file contains 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'), | |
uuid = '842AF9C408F511E39282F23C91AEC05E', | |
major = 65000, | |
minor = 65000, | |
measuredPower = -59; | |
var intervalId = setInterval(function() { | |
bleno.stopAdvertising(); | |
minor++; | |
if (minor > 65009) { |
This file contains 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
/* | |
Advertise a URL in the ( | |
*/ | |
#include <RFduinoBLE.h> | |
// the advertisement packet is composed of a series of variable length blocks, that can appear in any order. | |
// each block starts with a length byte, followed by a type byte, followed by the data. | |
// the payload cannot exceed 31 bytes. | |
// Note: since the RFduino UUID is missing from the advertisement packet, the RFduino iPhone apps will not |
This file contains 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
// Receive a NDEF message from a Peer | |
// Requires SPI. Tested with Seeed Studio NFC Shield v2 | |
#include "SPI.h" | |
#include "PN532_SPI.h" | |
#include "snep.h" | |
#include "NdefMessage.h" | |
PN532_SPI pn532spi(SPI, 10); | |
SNEP nfc(pn532spi); |