Skip to content

Instantly share code, notes, and snippets.

View soundanalogous's full-sized avatar

Jeff Hoefs soundanalogous

  • San Francisco, CA
View GitHub Profile
@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() {
@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 / 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 / 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 / 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
#include <ConfigurableFirmata.h>
#include <DigitalInputFirmata.h>
DigitalInputFirmata digitalInput;
#include <DigitalOutputFirmata.h>
DigitalOutputFirmata digitalOutput;
#include <AnalogInputFirmata.h>
AnalogInputFirmata analogInput;
@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.
/*
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
/*
OneWireFirmata.cpp - Firmata library
Copyright (C) 2012-2013 Norbert Truchsess. All rights reserved.
Copyright (C) 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
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
@soundanalogous
soundanalogous / ble-firmata-test.js
Last active December 30, 2016 17:24
node.js example for StandardFirmataBLE with Arduino 101
/*
* Make sure the Intel Curie Boards by Intel board package version 1.0.6 or higher is installed
* via the Arduino Boards Manager
*
* Compile and upload StandardFirmataBLE from the firmata/arduino master branch.
*
* To run, install the following modules:
* npm install ble-serial
* npm install firmata
*