Vma301


#1

for my Arduino I bought a DS1302 (=VMA301) from Velleman.

I downloaded from your site the files, including the library of DS1302RTC. h .

When i compile DS1302_RAM_DEMO I obtained following error:

C:\Program Files \ Arduino \ libraries \ DS1302/DS1302RTC. h:
97:26: error: ’ tmElements_t ’ has not been declared static uint8_t read (tmElements_t & tm);
^

C:\Program Files \ Arduino \ libraries \ DS1302/DS1302RTC. h:
98:27: error: ’ tmElements_t ’ has not been declared static uint8_t write (tmElements_t & tm);
^

exit status 1 error when you compile board Arduino Mega ADK

can you give me the correct version of the library DS1302RTC. h and DS1302RTC. ccp or tell me what to do to get it compilable?

Greetings
Erwin


#2

Dear Velleman,

I’ve got the same issue as mentioned above. There’s no time.h library included with Arduino 1.8.5, and i think this is the issue. The DS1302RTC.h was propperly imported. This is the error message when running the first example file included with the DS1302RTC library:

Arduino: 1.8.5 (Windows 10), Board: “Arduino Nano, ATmega328P”

In file included from C:\Users\Koe\Downloads\vm301_library\DS1302RTC\examples\DS1302_LCD\DS1302_LCD.ino:24:0:

C:\Users\Koe\Documents\Arduino\libraries\DS1302RTC/DS1302RTC.h:97:26: error: ‘tmElements_t’ has not been declared

 static  uint8_t read(tmElements_t &tm);

                      ^

C:\Users\Koe\Documents\Arduino\libraries\DS1302RTC/DS1302RTC.h:98:27: error: ‘tmElements_t’ has not been declared

 static  uint8_t write(tmElements_t &tm);

                       ^

DS1302_LCD:38: error: ‘POSITIVE’ was not declared in this scope

LiquidCrystal lcd(8, 9, 4, 5, 6, 7, 10, POSITIVE);

                                           ^

C:\Users\Koe\Downloads\vm301_library\DS1302RTC\examples\DS1302_LCD\DS1302_LCD.ino: In function ‘void setup()’:

DS1302_LCD:73: error: ‘setSyncProvider’ was not declared in this scope

setSyncProvider(RTC.get); // the function to get the time from the RTC

                      ^

DS1302_LCD:74: error: ‘timeStatus’ was not declared in this scope

if(timeStatus() == timeSet)

             ^

DS1302_LCD:74: error: ‘timeSet’ was not declared in this scope

if(timeStatus() == timeSet)

                  ^

C:\Users\Koe\Downloads\vm301_library\DS1302RTC\examples\DS1302_LCD\DS1302_LCD.ino: In function ‘void loop()’:

DS1302_LCD:90: error: ‘hour’ was not declared in this scope

print2digits(hour());

                 ^

DS1302_LCD:92: error: ‘minute’ was not declared in this scope

print2digits(minute());

                   ^

DS1302_LCD:94: error: ‘second’ was not declared in this scope

print2digits(second());

                   ^

DS1302_LCD:97: error: ‘day’ was not declared in this scope

if(sday != day()) {

              ^

DS1302_LCD:100: error: ‘weekday’ was not declared in this scope

 lcd.print(dayShortStr(weekday()));

                               ^

DS1302_LCD:100: error: ‘dayShortStr’ was not declared in this scope

 lcd.print(dayShortStr(weekday()));

                                ^

DS1302_LCD:107: error: ‘month’ was not declared in this scope

 print2digits(month());

                    ^

DS1302_LCD:109: error: ‘year’ was not declared in this scope

 lcd.print(year());

                ^

DS1302_LCD:112: error: ‘timeStatus’ was not declared in this scope

if(timeStatus() != timeSet) {

             ^

DS1302_LCD:112: error: ‘timeSet’ was not declared in this scope

if(timeStatus() != timeSet) {

                  ^

DS1302_LCD:118: error: ‘day’ was not declared in this scope

sday = day();

          ^

exit status 1
‘POSITIVE’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

I’m not a very experienced programmer and need the libraries to make the RTC work. So currently I can’t get the RTC to work. Could you please help us?
Koen