I'm new to this website so I'm not 100% sure how to use it so just try to bear with me. I'm following "the most complete starter kit for mega V1.0.19.09.02.pdf" that I copied from the CD the kit came with. At lesson 19 "Real Time Clock Module" I ran into the error, Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
DS1307_Example:7:1: error: 'RTCDateTime' does not name a type
RTCDateTime dt;
^
C:\Users\chick\Desktop\Elegoo\code\Lesson 19 Real Time Clock Module\DS1307_Example\DS1307_Example.ino: In function 'void setup()':
DS1307_Example:15:9: error: 'class DS3231' has no member named 'begin'
clock.begin();
^
DS1307_Example:22:9: error: 'class DS3231' has no member named 'setDateTime'
clock.setDateTime(2020, 1, 15, 22, 37, 00);
^
C:\Users\chick\Desktop\Elegoo\code\Lesson 19 Real Time Clock Module\DS1307_Example\DS1307_Example.ino: In function 'void loop()':
DS1307_Example:31:3: error: 'dt' was not declared in this scope
dt = clock.getDateTime();
^
DS1307_Example:31:14: error: 'class DS3231' has no member named 'getDateTime'
dt = clock.getDateTime();
^
exit status 1
'RTCDateTime' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Thanks ahead of time to all who can help! Sorry if I am too detailed, not detailed enough, or used the wrong details! I made sure to install the required libraries.
//www.elegoo.com
//2018.10.24
#include <Wire.h>
#include <DS3231.h>
DS3231 clock;
RTCDateTime dt; This is where it said the error was.
void setup()
{
Serial.begin(9600);
Serial.println("Initialize RTC module");
// Initialize DS3231
clock.begin();
// Manual (YYYY, MM, DD, HH, II, SS
// clock.setDateTime(2016, 12, 9, 11, 46, 00);
// Send sketch compiling time to Arduino
clock.setDateTime(2020, 1, 15, 22, 37, 00);
/*
Tips:This command will be executed every time when Arduino restarts.
Comment this line out to store the memory of DS3231 module
*/
}
void loop()
{
dt = clock.getDateTime();
// For leading zero look to DS3231_dateformat example
Serial.print("Raw data: ");
Serial.print(dt.year); Serial.print("-");
Serial.print(dt.month); Serial.print("-");
Serial.print(dt.day); Serial.print(" ");
Serial.print(dt.hour); Serial.print(":");
Serial.print(dt.minute); Serial.print(":");
Serial.print(dt.second); Serial.println("");
delay(1000);
}