Skip to content

Instantly share code, notes, and snippets.

View garthoff's full-sized avatar

T. Garthoff garthoff

View GitHub Profile
@garthoff
garthoff / motion.cpp
Last active August 29, 2015 14:26 — forked from zsup/motion.cpp
Spark.publish() + PIR motion sensor
/*
* Connected sensor
* Spark.publish() + PIR motion sensor = awesome
* Thanks to Adafruit for the reference and inspiration
*/
int inputPin = D0; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int calibrateTime = 10000; // wait for the thingy to calibrate
@garthoff
garthoff / gist:3713740
Created September 13, 2012 11:38 — forked from jeje/gist:3027236
Arduino Sketch recording raw IR signal and sending it through an infrared LED again every 2 seconds
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
boolean recording = true;
decode_results results;