Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 20046

Arduino-Edison IDE + Time & DS1307 Library

$
0
0

Hello,

 

I have a post similar to the one that I'm about to post but I felt that this one needed a new thread. I have Arduino code that works fine in my old Arduino IDE and it uses the libraries Time and DS1307, where DS1307 is meant to work with the Time library. Now when I simply copy my code over to the new Arduino-Edison IDE I get the following message concerning my Time.h file:

 

---------------------------------------------------------------------------------------------- ERROR ----------------------------------------------------------------------------------------------------------------------------

 

In file included from C:\Arduino_Edison_IDE/hardware/tools/edison/sysroots/core2-32-poky-linux/usr/include/sys/types.h:132:0,

                from C:\Arduino_Edison_IDE/hardware/tools/edison/sysroots/core2-32-poky-linux/usr/include/stdlib.h:314,

                from C:\Arduino_Edison_IDE\hardware\arduino\edison\cores\arduino/WString.h:26,

                from C:\Arduino_Edison_IDE\hardware\arduino\edison\cores\arduino/Print.h:26,

                from C:\Arduino_Edison_IDE\hardware\arduino\edison\cores\arduino/Stream.h:26,

                from C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Wire/Wire.h:24,

                from Impulse_Counter_Clock.ino:1:

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:83:22: error: declaration of C function 'int hour(time_t)' conflicts with

int    hour(time_t t);    // the hour for the given time

                      ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:82:9: error: previous declaration 'int hour()' here

int    hour();            // the hour now

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:85:30: error: declaration of C function 'int hourFormat12(time_t)' conflicts with

int    hourFormat12(time_t t); // the hour for the given time in 12 hour format

                              ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:84:9: error: previous declaration 'int hourFormat12()' here

int    hourFormat12();    // the hour now in 12 hour format

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:87:22: error: declaration of C function 'uint8_t isAM(time_t)' conflicts with

uint8_t isAM(time_t t);    // returns true the given time is AM

                      ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:86:9: error: previous declaration 'uint8_t isAM()' here

uint8_t isAM();            // returns true if time now is AM

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:89:22: error: declaration of C function 'uint8_t isPM(time_t)' conflicts with

uint8_t isPM(time_t t);    // returns true the given time is PM

                      ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:88:9: error: previous declaration 'uint8_t isPM()' here

uint8_t isPM();            // returns true if time now is PM

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:91:24: error: declaration of C function 'int minute(time_t)' conflicts with

int    minute(time_t t);  // the minute for the given time

                        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:90:9: error: previous declaration 'int minute()' here

int    minute();          // the minute now

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:93:24: error: declaration of C function 'int second(time_t)' conflicts with

int    second(time_t t);  // the second for the given time

                        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:92:9: error: previous declaration 'int second()' here

int    second();          // the second now

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:95:21: error: declaration of C function 'int day(time_t)' conflicts with

int    day(time_t t);    // the day for the given time

                    ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:94:9: error: previous declaration 'int day()' here

int    day();            // the day now

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:97:25: error: declaration of C function 'int weekday(time_t)' conflicts with

int    weekday(time_t t); // the weekday for the given time

                        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:96:9: error: previous declaration 'int weekday()' here

int    weekday();        // the weekday now (Sunday is day 1)

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:99:23: error: declaration of C function 'int month(time_t)' conflicts with

int    month(time_t t);  // the month for the given time

                      ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:98:9: error: previous declaration 'int month()' here

int    month();          // the month now  (Jan is month 1)

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:101:22: error: declaration of C function 'int year(time_t)' conflicts with

int    year(time_t t);    // the year for the given time

                      ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:100:9: error: previous declaration 'int year()' here

int    year();            // the full four digit year: (2009, 2010 etc)

        ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:105:66: error: declaration of C function 'void setTime(int, int, int, int, int, int)' conflicts with

void    setTime(int hr,int min,int sec,int day, int month, int yr);

                                                                  ^

C:\Arduino_Edison_IDE\hardware\arduino\edison\libraries\Time/time.h:104:9: error: previous declaration 'void setTime(time_t)' here

void    setTime(time_t t);

        ^

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Now AlphaCHarly had a thread and posted a Time.h that seemed different from mine, so at this point I was desperate and gave it a shot, and it worked!

However, it ruined my code because now DS1307 library wasn't working properly since it works with the Time library which has now changed.

 

So my question is if anyone would now how to resolve the error message above? Which is resulting due to the Arduino-Edison saying multiple declarations are being made for the same variable.

 

Any insight or direction would be very appreciated


Viewing all articles
Browse latest Browse all 20046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>