This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IRremote.h> | |
int RECV_PIN = 11; | |
IRrecv irrecv(RECV_PIN); | |
IRsend irsend; | |
boolean recording = true; | |
decode_results results; |