DS3231 Oscillator TEst
/*H*******************************************************
oscillator_test.pde
Eric Ayars
4/11 Test/demo of oscillator routines for a DS3231 RTC.
Use a scope after loading this to check if things are
working as they should.
********************************************************/
#include <DS3231.h>
#include <Wire.h>
//************************* DEFINES ************************************
//************************* PROTOTYPES ************************************
//************************* VARIABLES ************************************
DS3231 myRTC;
byte j;
bool on = false;
/*F********************************************************************
*
**********************************************************************/
void
setup()
{
Wire.begin(); // Start the I2C interface
Serial.begin( BAUD ); // Start the serial interface
}
/*F********************************************************************
*
**********************************************************************/
void
loop()
{
for( j =0; j < 4; j++)
{ // INVERT STATE OF 32KhZ OSCILLATOR
on = !on;
myRTC.enable32kHz( on );
// Turn on oscillator pin, frequency j
myRTC.enableOscillator( true, false, j);
delay( 4000 );
}
// So... 32kHz oscillator (pin 1) will turn on or off once each 2s,
// and oscillator out pin (pin 3) will cycle through frequencies.
}