Skip to content

Instantly share code, notes, and snippets.

// Using Plot.ly's Arduino API to visualize Temperature and Humidity Readings from A DHT22 Sensor
#define DELAY_OFFSET 11
#define BEEP_PIN 5
#define audioLOW 250
#define audioHIGH 2000
#define tempLOW 0
#define tempCHILLY 18
#define tempMED 30
/*
* Append Example
*
* This sketch shows how to use open for append.
* The sketch will append 100 line each time it opens the file.
* The sketch will open and close the file 100 times.
*/
#include <SdFat.h>
int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//long pulseCount = 0;
unsigned long pulseTime,lastTime, duration;
void setup()
{
Serial.begin(9600);
// KWH interrupt attached to IRQ 1 = pin3
attachInterrupt(1, onPulse, FALLING);
}
long pulseCount = 0; //a pulse counter variable
unsigned long pulseTime,lastTime, duration, totalDuration;
int samplingPeriod=2; // the number of seconds to measure 555 oscillations
int fivefivefive = 13; // the pin that powers the 555 subcircuit
void setup()
{
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
long pulseCount = 0; //a pulse counter variable
unsigned long pulseTime,lastTime, duration, totalDuration;
int samplingPeriod=2; // the number of seconds to measure 555 oscillations
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
long pulseCount = 0; //a pulse counter variable
unsigned long pulseTime,lastTime, duration, totalDuration;
int samplingPeriod=2; // the number of seconds to measure 555 oscillations
@dwblair
dwblair / dwbThermistorRtcSD1LowPow.ino
Created June 9, 2014 12:59
Riffle-ito REVC: measuring RTC temp and thermistor temp, and recording values (with RTC unix timestamp) to SD card (and flashing LED); deep sleep for 5 seconds in between measurements
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
// which analog pin to connect
#define THERMISTORPIN A2
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25
@dwblair
dwblair / riffleitoBase1.ino
Created June 9, 2014 18:01
Shuts down SD card and sensor and sleeps in-between measurements.
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
// which analog pin to connect
#define THERMISTORPIN A2
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25
@dwblair
dwblair / RiffleBase2.ino
Created June 9, 2014 18:13
Measure thermistor and RTC temp and battery level, record to SD card, and in between measurements: sleep and shut down power to SD card and sensors.
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
#define outFileName "testDWB6.csv"
#define BATTERYPIN A3
// which analog pin to connect
@dwblair
dwblair / riffleitoBase3.ino
Created June 9, 2014 20:28
no SD shutdown -- works. next version: SD shutdown.
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
#define outFileName "testDWB7.csv"
#define BATTERYPIN A3
// which analog pin to connect