Skip to content

Instantly share code, notes, and snippets.

View jacobrosenthal's full-sized avatar

Jacob Rosenthal jacobrosenthal

View GitHub Profile
@jacobrosenthal
jacobrosenthal / gist:2fb4611fe1911e43e16a
Created December 23, 2014 23:51
Firmata.cpp write received out to scratch 1
/*
Firmata.cpp - Firmata library
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
See file LICENSE.txt for further informations on licensing terms.
@jacobrosenthal
jacobrosenthal / gist:2577f1116d3b8fe0414e
Created January 12, 2015 00:42
Standard Firmata 1.0.6 with ScratchSerial and SplitStream for debugging
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@jacobrosenthal
jacobrosenthal / gist:168172ad412f193a9814
Last active August 29, 2015 14:14
Arduino 1.5 TCP Firmata
#include <CombineStreams.h>
#include <TapStream.h>
#include <TCPSerial.h>
#include <SPI.h>
#include <Ethernet.h>
// network configuration. gateway and subnet are optional.
// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
@jacobrosenthal
jacobrosenthal / gist:bb61d2c2c06ec3d48b4d
Created February 27, 2015 03:44
chrome.serial.update bug
function convertArrayBufferToString(buf){
var bufView = new Uint8Array(buf);
var encodedString = String.fromCharCode.apply(null, bufView);
return decodeURIComponent(encodedString);
}
var onReceiveCallback = function(info) {
console.log('received', convertArrayBufferToString(info.data));
};
@jacobrosenthal
jacobrosenthal / gist:b613b27110d0ab28f021
Created March 18, 2015 07:51
Gulp Webpack Babel Emscripten
Jacobs-MacBook-Air-2:ChromeIDE jacobrosenthal$ npm run build
> [email protected] build /Users/jacobrosenthal/Desktop/ChromeIDE
> gulp
[00:50:05] Requiring external module babel/register
[00:50:06] Using gulpfile ~/Desktop/ChromeIDE/gulpfile.babel.js
[00:50:06] Starting 'default'...
[00:50:06] Starting 'js'...
Note: The code generator has deoptimised the styling of "/Users/jacobrosenthal/Desktop/bs2-serial/lib/a.out.js" as it exceeds the max of "100KB".
jacobs-air-2:chromebots jacobrosenthal$ npm run serve
> [email protected] serve /Users/jacobrosenthal/Desktop/chromebots
> webpack-dev-server
http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from /Users/jacobrosenthal/Desktop/chromebots
/Users/jacobrosenthal/Desktop/chromebots/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/middleware.js:85
@jacobrosenthal
jacobrosenthal / .travis.yml
Created April 1, 2015 07:04
Arduino command line travis testing
# Test build your arduino libraries with travis and the official arduino tool chain
# assumes directory structure
# /NullStream
# NullStream.h
# NullStream.cpp
# examples
# NullStreamExample
# NullStreamExample.ino
RollingSpider = require("rolling-spider");
var temporal = require("temporal");
var options = { uuid: "fa4e842bacc44b11850653e3dced8110",
logger: console.log};
var yourDrone = new RollingSpider(options);
yourDrone.connect(function() {
console.log("connect");
yourDrone.setup(function() {
RollingSpider finding: fa4e842bacc44b11850653e3dced8110
RollingSpider.on(stateChange)
RollingSpider#poweredOn
RollingSpider.on(discover)
f883f1d7d07b4e9fabe23426c2c2fc82
undefined
-1
-1
RollingSpider.on(discover)
aabc4123e4fd4c1fb276a8c9b1496210
@jacobrosenthal
jacobrosenthal / gist:11a20b87d9da65c46ee5
Created May 29, 2015 17:32
Minidrone Rolling Spider UUIDS
Discovered characteristic 9a66fa000800919111e4012d1540cb8e
Discovered characteristic 9a66fa010800919111e4012d1540cb8e
Discovered characteristic 9a66fa020800919111e4012d1540cb8e
Discovered characteristic 9a66fa030800919111e4012d1540cb8e
Discovered characteristic 9a66fa040800919111e4012d1540cb8e
Discovered characteristic 9a66fa050800919111e4012d1540cb8e
Discovered characteristic 9a66fa060800919111e4012d1540cb8e
Discovered characteristic 9a66fa070800919111e4012d1540cb8e
Discovered characteristic 9a66fa080800919111e4012d1540cb8e
Discovered characteristic 9a66fa090800919111e4012d1540cb8e