Other Parts Discussed in Thread: ENERGIA
Dear All,
I am developing a timer controlled home appliance using MSP430G2553 uc and DS1307 RTC module. I have done the code in energia and uploaded into the MSP430 and monitored through serial monitor.
Unfortunately it was showing like,
2000/0/0 0:0:0
2000/0/0 0:0:0
2000/0/0 0:0:0
Here is my code,
#include <Wire.h>
#include <RTClib.h>
RTC_DS1307 RTC;
void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
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__));
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(3000);
}
I have used 2 numbers of 1.7 k ohm resistors as pull up for both SCL and SDA.
Your valuable support is required.