Skip to content

Instantly share code, notes, and snippets.

View dmiddlecamp's full-sized avatar

David Middlecamp dmiddlecamp

View GitHub Profile
@dmiddlecamp
dmiddlecamp / nyan.ino
Created January 20, 2015 20:17
Sample Spark.function 'nyan' / rainbow firmware!
void setup() {
Spark.function("nyan", nyanHandler);
}
void loop() {
//nothing to see here!
}
int nyanHandler(String cmd) {
if (cmd == "on") {
#define PIN_MOTOR D0
#define PIN_SOUND D4
#define PIN_MOTION D2
#define MAX_DANCE_TIME 2 * 60 * 1000
unsigned int started_dancing = 0;
bool dancing = false, wasMotion = false;
@rlogiacco
rlogiacco / PingPong.cpp
Last active January 4, 2016 03:59
PingPong nRF24L01+ example for Spark Core using pins 5 CE and 6 CSN
#ifndef Binary_h
#define Binary_h
#define B0 0
#define B00 0
#define B000 0
#define B0000 0
#define B00000 0
#define B000000 0
#define B0000000 0
@technobly
technobly / sparkBMP085.cpp
Last active January 2, 2016 18:19
BMP085/BMP180 Barometric Pressure + Temp sensor for Spark Core
//-----------------------------------------------------------------
// BMP085/BMP180 Barometric Pressure + Temp sensor for Spark Core
//=================================================================
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//-----------------------------------------------------------------
// Technobly / BDub - Jan 2014
//=================================================================
/***************************************************