Skip to content

Instantly share code, notes, and snippets.

View jacobrosenthal's full-sized avatar

Jacob Rosenthal jacobrosenthal

View GitHub Profile
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 / 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".
@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: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: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: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:5044a5f660d2bda84060
Created December 23, 2014 21:42
StandardFirmata 1.x with Bean Sleep added
/* Standard Firmata altered for Bean.
* biggest change so far was just adding Bean sleep at the end of loop to
* allow bean to sleep for power saves. Adjust to taste
*
* The big gotcha is that theyve actually moved pins around. Until we find
* a way around this, dont use the pins marked on the Bean, but rather:
* a0 -> a4
* a1 -> a5
* d0 -> d6
* d1 -> d9
@jacobrosenthal
jacobrosenthal / gist:67035493e0e3bd708fd4
Created December 7, 2014 14:22
Light Blue Bean Slider Control 2 Servos
#define LEFT 0
#define RIGHT 2
int leftServoPin = 0;
int rightServoPin = 1;
void setup(){
pinMode(leftServoPin, OUTPUT);
pinMode(rightServoPin, OUTPUT);
@jacobrosenthal
jacobrosenthal / gist:69093da97374ea8efc2a
Created December 7, 2014 08:57
Light Blue Bean Slider Control Servo Example
#define CONTROL 0
int servoPin = 0;
void setup(){
pinMode(servoPin, OUTPUT);
}
void loop(){
@jacobrosenthal
jacobrosenthal / gist:28eb72774bd720c5ca31
Created October 3, 2014 04:52
openocd cleaning, patching configuring and running
jacob-2:openocd jacobrosenthal$ git reset HEAD --hard
HEAD is now at c0b8e60 command: Fix confusing syntax error message
jacob-2:openocd jacobrosenthal$ git clean -f -d
Removing src/target/adi_v5_swd.c.orig
jacob-2:openocd jacobrosenthal$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
jacob-2:openocd jacobrosenthal$ patch -p1 < ~/Downloads/2e596cb0.diff