Hi everyone, i’ll try shortly to describe the problem.
I’ve 2 Seeeduino Stalker boards (328 and 168), 2 XBee-PRO modules and 1 UART_SB v2.2 board, so after i uploaded a sketch like this below on the Stalker 328, happens something strange.
[code]#include <Wire.h>
#include “RTClib.h”
RTC_DS1307 RTC;
void setup () {
Serial.begin(57600);
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();
Serial.print(" since midnight 1/1/1970 = ");
Serial.print(now.unixtime());
Serial.print("s = ");
Serial.print(now.unixtime() / 86400L);
Serial.println("d");
// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now.unixtime() + 7 * 86400L + 30);
Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();
Serial.println();
delay(3000);
}[/code]
Serial output(connection PC<-UART_SB<-STALKER) is like this
2010/8/19 16:49:2
since midnight 1/1/1970 = 1282236542s = 14840d
now + 7d + 30s: 2010/8/26 16:49:32
But then if the connection changed (PC<-UART_SB<-XBEE_C<- <-XBEE_R<-STALKER )
output is like this
2000/0/0 0:0:0
since midnight 1/1/1970 = 2313941504s = 26781d
now + 7d + 30s: 2043/5/6 17:32:14
BUT if i use Stalker 168 everything is OK.
Does anyone know what the f*** is it?
Thanks in advance.