Skip to content

Instantly share code, notes, and snippets.

//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
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
#define outFileName "humid1.csv"
#define BATTERYPIN A3
#include <JeeLib.h>
ISR(WDT_vect) { Sleepy::watchdogEvent(); }
#define outFileName "poop3.csv"
#define BATTERYPIN A3