I have used the example program Adafruit provided but I am puzzled that "RTC is not Running"does not show.
I attach the code and would appreciate help on this point.
Since starting to write this I have experimented further and I find that I can cause a dead short across the battery by pressing it down near the edge. I suspect that solder has run under from the 2 side-connections of the holder. Maybe that was the cause though in the normal position there is no short. Has this been reported before?
Code: Select all
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
#define TEMP_PIN 2 //See Note 1, sheepdogguides..ar3ne1tt.htm
#include <PinChangeInt.h>
#include <PinChangeIntConfig.h>
#define PIN 3 // the pin for button
volatile byte burp=0; // a counter to see how many times the pin has changed
volatile long mon=0;
volatile int dy=0;
volatile int hr=0;
volatile int mn=0;
volatile int sec=0;
volatile int flag=0;
int nflag;
byte cmd=0; // a place to put our serial data
void OneWireReset(int Pin);//See Note 2
void OneWireOutByte(int Pin, byte d);
byte OneWireInByte(int Pin);
void setup() {
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");}
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
digitalWrite(TEMP_PIN, LOW);
pinMode(TEMP_PIN, INPUT); // sets the digital pin as input (logic 1)
Serial.begin(9600);
Wire.begin();
RTC.begin();
delay(100);
Serial.print("temperature measurement:\n");
Serial.print("PinChangeInt test on pin ");
Serial.print(PIN);
Serial.println();
pinMode(PIN, INPUT); //set the pin to input
digitalWrite(PIN, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(PIN, burpcount,FALLING); // attach a PinChange Interrupt to our pin on the rising edge
// (RISING, FALLING and CHANGE all work with this library)
// and execute the function burpcount when that pin changes
}
void loop()