Skip to content

Instantly share code, notes, and snippets.

David Resseguie Resseguie

Block or report user

Report or block Resseguie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Resseguie
Resseguie / gist:8294929
Created Jan 7, 2014
Attempting to send analog data from Spark Core to Thingspeak. (Note: Something still not fully working. First post works, then it hangs.)
View gist:8294929
// ThingSpeak Settings
char thingSpeakAddress[] = "api.thingspeak.com";
String writeAPIKey = "THINGSPEAK_WRITE_API";
const unsigned int updateThingSpeakInterval = 30000;
unsigned long lastConnectionTime = 0;
bool lastConnected = false;
int failedCounter = 0;
TCPClient client;
@Resseguie
Resseguie / gist:8302903
Created Jan 7, 2014
Oversimplified method of sending ThingSpeak updates from Spark Core. (Not really recommended for real world use.) This connects and sends data successfully several times, but eventually something hangs and it stops updating.
View gist:8302903
// ThingSpeak Settings
char thingSpeakAddress[] = "api.thingspeak.com";
String writeAPIKey = "THINGSPEAK_WRITE_KEY";
const unsigned int updateThingSpeakInterval = 30000;
// Variable Setup
unsigned long lastConnectionTime = 0;
// Initialize TCP Client
TCPClient client;
View sparkio-test.js
var five = require("johnny-five");
var Spark = require("spark-io");
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
})
});
View servo-zero-error.js
var Spark = require("spark-io");
var board = new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
});
board.on("ready", function() {
console.log("CONNECTED");
this.pinMode("D0", this.MODES.OUTPUT);
View sparkio-servo-cli.js
var Spark = require('spark-io');
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var board = new Spark({
View sparkio-led.js
var five = require("johnny-five");
var Spark = require("spark-io");
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
})
});
View rgb.js
var five = require("johnny-five");
var Spark = require("../lib/spark");
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
})
});
@Resseguie
Resseguie / spark-io-rgb.js
Created Jun 3, 2014
Spark-IO LED-RGB Example
View spark-io-rgb.js
var five = require("johnny-five"),
Spark = require("../lib/spark"),
keypress = require('keypress'),
board;
// Create Johnny-Five board connected via Spark
board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
@Resseguie
Resseguie / servo-prompt.js
Created Jun 3, 2014
Simple example using spark-io and continuous servo
View servo-prompt.js
var Spark = require('../lib/spark');
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var board = new Spark({
View rgb-led-on.js
var five = require('johnny-five'),
Spark = require('../lib/spark'),
board;
// Create Johnny-Five board connected via Spark
board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
You can’t perform that action at this time.