I am trying to get my DS1307 RTC clock to work. here's the code:
#include <DS1307RTC.h>
#include <Wire.h>
#include <Time.h>
const char *monthName[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
tmElements_t tm;
void setup() {
bool parse = false;
bool config = false
if (getDate(DATE) && getTime(TIME)) {
parse = true;
if (RTC.write(tm)) {
config = true;
}
}
Serial.begin(9600);
while (!Serial) ;
delay(200);
if (parse && config) {
Serial.print("DS1307 configured time=");
Serial.print(TIME);
Serial.print(", Date");
Serial.println(DATE);
} else if (parse) {
Serial.println("DS1307 Communication Error : - {");
Serial.println("please check your circuitry");
} else {
Serial.print("Could not parse info from the compiler, Time=/"");
Serial.print(TIME);
Serial.print("", Date="")
Serial.print(DATE);
Serial.println(""")
}
}
void loop() {
}
bool getTime(const cha *str)
{
int Hour, Min, Sec;
if (sscanf(str, "%d:%d:%d", &Hour, &Min, &Sec) != 3 return false;
tm.Hour = Hour;
tm.Minute = Min;
tm.Second = Sec;
return true;
}
}
and here's the error:
In file included from C:\Users\sethl\OneDrive\Desktop\building\Projects\RTC\RTC.ino:1:0:
C:\Users\sethl\OneDrive\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:9:21: fatal error: TimeLib.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
please help!!!