Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
#define switchPin 12
File logfile;
bool stopPin = true;
long pulseCount = 0; //a pulse counter variable
unsigned long pulseTime,lastTime, duration, totalDuration;
int samplingPeriod=4; // the number of seconds to measure 555 oscillations
int fivefivefive = 13; // the pin that powers the 555 subcircuit
void setup()
{
#include "LowPower.h" //https://github.com/rocketscream/Low-Power
#include <Wire.h>
#include <SPI.h>
#include <DS3232RTC.h> //http://github.com/JChristensen/DS3232RTC
#include<stdlib.h>
#include <SD.h>
#include <Time.h>
//sleeping stuff
#define sleep_intervals 1
// Output 20kHz PWM on timer TCC0 (8-bit resolution)
void setup()
{
REG_GCLK_GENDIV = GCLK_GENDIV_DIV(3) | // Divide the 48MHz clock source by divisor 3: 48MHz/3=16MHz
GCLK_GENDIV_ID(4); // Select Generic Clock (GCLK) 4
while (GCLK->STATUS.bit.SYNCBUSY); // Wait for synchronization
REG_GCLK_GENCTRL = GCLK_GENCTRL_IDC | // Set the duty cycle to 50/50 HIGH/LOW
GCLK_GENCTRL_GENEN | // Enable GCLK4
GCLK_GENCTRL_SRC_DFLL48M | // Set the 48MHz clock source
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
#define switchPin 12
File logfile;
bool stopPin = true;
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
#define switchPin 12
File logfile;
bool stopPin = true;
// Demo Code for SerialCommand Library
// Craig Versek, Jan 2014
// based on code from Steven Cogswell, May 2011
#include <SerialCommand.h>
#include <RTCZero.h>
#define arduinoLED 13 // Arduino LED on board
SerialCommand sCmd(Serial); // The demo SerialCommand object, initialize with any Stream object
/*
Simple RTC Alarm for Adafruit Feather M0 modified
with repeated serial output each time the board wakes
By: CaveMoa
Date: 30/12/15
*/
//#define Serial SerialUSB
#include <RTCZero.h>
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
#define switchPin 12
File logfile;
bool stopPin = true;