Some key points for background:
Using a WEMOS D1 R2 Board
My project im trying to create in an RGB LED that can be manually controlled by a potentiometer. But it will also gradually change colour according to the time of day, hence my RTC problem.
I decided to first try get the LED and potentiometer working which is all fine and done.
Now separately in a different program get an RTC working to add to the project. I'm having an error showing "'RifTime' does not name a type". I also have another error saying "'Class DS3231' has no member named 'set clock'". I took this RTC code from my class resources but I'm still seeming to have these errors.
I believe the problem is to do with the DS3231 library and that it's the wrong one. But im not sure how to know which is the right one to download and select it? I can only find 2 versions online and have been using the most recent one but I did try the older version which didnt seem to work either.
#include <DS3231.h>
#include <Streaming.h>
#include <SPI.h>
#include <Wire.h>
DS3231 rtc;
int hour;
int minute;
int second;
bool h12;
bool PM;
char buffer[24];
void setup()
{
Wire.begin();
Serial.begin(115200);
Serial.println(F("\nDS3231 Hi Precision Real Time Clock"));
int seconds, minutes, hours, dayofweek, dayofmonth, month, year;
hours = 2;
minutes = 30;
seconds =30;
year = 2019;
month = 11;
dayofmonth = 29;
rtc.setClock(year,month,dayofmonth,hours,minutes,seconds);
}
void loop()
{
rtc.getTime(t);
Serial << rtc.toString(buffer) << endl;
Serial << rtc.getTemperature() << " C" << endl;
Serial << "Timestamp: " << rtc.getTimestamp() << endl;
delay( 1000);
}
Any help much appreciated, been stuck on this for a while.