Show Posts
Pages: [1]
1  Products / Arduino Due / Re: Dual I2C on Arduino DUE on: January 18, 2013, 07:33:28 pm

Wire and Wire1 for I2C and I2C1 receptivity.  

See Wire.h for details...

extern TwoWire Wire;
extern TwoWire Wire1;


2  Products / Arduino Due / Re: Due compatible Time library? on: January 17, 2013, 07:57:46 pm
Hello Paul Stoffregen,

I have tested your version of Time and it's remotely to be ported for Due. Actually I already did the time_t variable name change, but that is not the only thing that need to be modified (I did it as bperrybap suggest thought).

#include <machine/types.h>

#ifndef __time_t_defined
//typedef unsigned long time_t; // original library typedef.
typedef _TIME_T_ time_t;
#define __time_t_defined

After that I have been through several compiling errors I would like to bring them here.
First with setTime function, it seems that overloading that function bothers the compiler
previous declaration 'void setTime(atime_t)' here

I decide to remove (comment out) the version with more arguments as you can use the makeTime to have time_t from individual values.
I also have to remove from Time Folder the file DateStrings.cpp.

After all that I make a simple test file like this

#include <Wire.h>  
#include <Time.h>  

void setup()  {
  Serial.println("setup RTC test");

  tmElements_t t;
  t.Second = 0;
  t.Minute = 30;
  t.Hour = 19;
  t.Wday = 3;
  t.Day = 16;
  t.Month = 1;
  t.Year = y2kYearToTm(13);
  Serial.println("setup makeTime");
//  setTime(makeTime(t));
  Serial.println("how come  ");

void loop()

void digitalClockDisplay(){
  // digital clock display of the time
  time_t t = now();
  Serial.print(" ");
  Serial.print(" ");
  Serial.print(" ");

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  if(digits < 10)

the good thing is that it compiles but the bad is that a warning appears

test_time.cpp.o: In function `setup':
C:\...\arduino-1.5.1r2/test_time.ino:24: warning: undefined reference to `makeTime(tmElements_t&)'
Binary sketch size: 25,856 bytes (of a 524,288 byte maximum)

I recently discover that if you put the Time.h include at the beginning of the import section it produces the above error and the Due hangs before it can print "how come".

If you put any other import before Time.h it compiles cleanly and run without problems.

Maybe it have to do with

Then the STUPID IDE also has an issue that rears it ugly head again that breaks this.
The IDE inserts its prologue which includes
#include "Arduino.h"
in the middle of the sketch .cpp file so it ends up after the
#include <Time.h>
So the system version of time_t doesn't get typed before the library Time.h looks at the define.
You have to insert some dummy code to coerce the silly IDE to put the prologue at the top of the .cpp file
I added this to the example sketch:
int dummy = 0;
right at the top of the sketch.

I found another issue, in file Time.h the line
typedef time_t(*getExternalTime)();

should be

typedef time_t(*getExternalTime)(void);

3  Products / Arduino Due / Time Library on: January 16, 2013, 10:32:24 pm
Hello to all,

I am trying to adapt the Time library for Due board. After getting rid of some problems with types and Progmem i finnaly make it to compile but with some warnings.

Every time I invoke a function from Time library, the compiler complains for example

 warning: undefined reference to `makeTime(tmElements_t&)'

I am attaching my library and .ino test file if someone can take a look. I will be very appreciated.

Thanks for reading,

P.S. i have ported this Time Library to chipKit Max32 whitout problems but Due is giving me a hard time.
Pages: [1]