virtuabotixRTC keeps giving me compilation errors

I'm trying to use an RTC module, here's the code:

#include <virtuabotixRTC.h>

virtuabotixRTC myRTC(6, 7, 8);

void setup() {
Serial.begin(9600);

myRTC.setDS1302Time(15, 22, 21, 7, 14, 1, 2018); //Here you write your actual time/date as shown above

}

void loop() {

myRTC.updateTime();

Serial.print("Current Date / Time: ");
Serial.print(myRTC.dayofmonth);
Serial.print("/");
Serial.print(myRTC.month);
Serial.print("/");
Serial.print(myRTC.year);
Serial.print(" ");
Serial.print(myRTC.hours);
Serial.print(":");
Serial.print(myRTC.minutes);
Serial.print(":");
Serial.println(myRTC.seconds);

delay(1000);
}

Error message:
/var/folders/yb/lp1wchdx0v764zc7tcnqqcj00000gp/T/arduino_modified_sketch_680707/sketch_may27a.ino:9:28: fatal error: virtuabotixRTC.h: No such file or directory
#include <virtuabotixRTC.h>
^
compilation terminated.
exit status 1
Error compilando para la tarjeta Arduino/Genuino Uno.

I don't get what's wrong, can anyone help?

" virtuabotixRTC.h: No such file or directory"

That almost always means "You forgot to install this library" or "You installed this library incorrectly".

That's the problem, I can't seem to find the library anywhere

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Serge_227:
That's the problem, I can't seem to find the library anywhere

Really? Where did you look for it, in your shoe? I have no problem finding a result on Google.

1 Like

Serge_227:
That's the problem, I can't seem to find the library anywhere

I found two of them.
arduino/libraries/virtuabotixRTC at master · javastraat/arduino · GitHub (4 years old)
GitHub - chrisfryer78/ArduinoRTClibrary: An easy to use real time clock library for Arduino, it was in the public domain, but not on GitHub, so I uploaded it. (3 years old and not original)

I tried to determine the "official" one but Virtuabotix.com says only:

Sorry, we're doing some work on the site
Thank you for being patient. We are doing some work on the site and will be back shortly. Stay TUNE

My guess is that the older (first) one is the most official.
Perhaps you should start with an example from a more recent library. If you select Sketch->Include Library...->Manage Libraries... and type DS1302 into the filter box you will find "RTCLib by NeiroN" which supports the DS1302. Just click on the description and then click on the "Install" button. You will find examples under File->Examples->RTCLib by NeiroN

1 Like