Skip to content

Instantly share code, notes, and snippets.

View soundanalogous's full-sized avatar

Jeff Hoefs soundanalogous

  • San Francisco, CA
View GitHub Profile
/*
I2CFirmata.h - Firmata library
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.
Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.
Copyright (C) 2013 Norbert Truchsess. All rights reserved.
Copyright (C) 2009-2016 Jeff Hoefs. 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
@soundanalogous
soundanalogous / StandardFirmataMemCheck.ino
Last active November 27, 2016 00:11
StandardFirmata with memory reporting
/*
* Dependencies:
* - This code depends on the ArduinUnit library. Get it here:
* https://github.com/mmurdoch/arduinounit and copy it to your
* Arduino libraries folder.
* - You must use a Firmata client library that has the STRING_DATA
* message implemented (node-firmata, johnny-five, BreakoutJS)
*
* Copy this into a new Arduino file, compile and upload.
* It will report the available memory approximately every 10 seconds.
#include <ConfigurableFirmata.h>
#include <DigitalInputFirmata.h>
DigitalInputFirmata digitalInput;
#include <DigitalOutputFirmata.h>
DigitalOutputFirmata digitalOutput;
#include <AnalogInputFirmata.h>
AnalogInputFirmata analogInput;
@soundanalogous
soundanalogous / StandardFirmataDebug.ino
Created August 24, 2016 04:43
StandardFirmata debug sketch
/*
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 list of Firmata client libraries your default browser.
https://github.com/firmata/arduino#firmata-client-libraries
@soundanalogous
soundanalogous / ethernetConfig.h
Created April 10, 2016 07:44
config file to accompany StandardFirmataESP.ino
/*==============================================================================
* NETWORK CONFIGURATION
*
* You must configure your particular hardware. Follow the steps below.
*
* Currently StandardFirmataEthernet is configured as a client. An option to
* configure as a server may be added in the future.
*============================================================================*/
// STEP 1 [REQUIRED]
@soundanalogous
soundanalogous / StandardFirmataESP.ino
Created April 10, 2016 07:43
ESP8266 Firmata WiFi client test
/*
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 list of Firmata client libraries your default browser.
https://github.com/firmata/arduino#firmata-client-libraries
@soundanalogous
soundanalogous / wifi-test.js
Last active March 26, 2016 03:00
simple example to test StandardFirmataWiFi (wire an LED to pin D8 and a potentiometer to pin A0)
/*
* Tested using node v0.12.7
* npm install etherport-client
* npm install firmata
*
* To run in Debug mode:
* DEBUG=etherport-client node wifi-test
*/
var Firmata = require("firmata").Board;
var EtherPortClient = require("etherport-client").EtherPortClient;
@soundanalogous
soundanalogous / hw-serial-gps.js
Created February 11, 2016 05:04
Test firmata hardware serial
var Board = require("firmata");
Board.requestPort(function(error, port) {
if (error) {
console.log(error);
return;
}
var board = new Board(port.comName);
board.on("ready", function() {
// treat the scope as read-only in views
// treat the scope as write-only in controllers
/**
* use attrs to read from scope
*/
<div my-attribute="propName">
app.directive('myDirective', function () {
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hello World</title>
</head>
<body>
<button id="ledToggle">Toggle LED</button>
<p id="btnStatus"></p>
<script src="../../dist/Breakout.js"></script>