error rtc

I have been getting rtc ds3231 doesnt name type error. How is it fixed and whats it mean.

Please post your full sketch. If possible, you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it’s OK to add it as an attachment. After clicking the “Reply” button, you will see an “Attachments and other settings” link.

Please post a link (using the chain links icon on the toolbar to make it clickable) to where you downloaded that library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Use CTRL T to format your code.
Attach your complete sketch between code tags
[code]Paste your sketch here[/code]

Use the </> icon

"doesn't name type error"

How do you know there is an error?

NOW Everytime i go to verify and compile, it wont load because it states “RTC DS3231 does not name a type” i dont have a clue as to what that means. can anyone help?

// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include <Wire.h>
#include “RTClib.h”
#include <Arduino.h>
#include <TM1637Display.h>

// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3

// The amount of time (in milliseconds) between tests
#define TEST_DELAY 2000

const uint8_t SEG_DONE = {
SEG_B | SEG_C | SEG_D | SEG_E | SEG_G, // d
SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F, // O
SEG_C | SEG_E | SEG_G, // n
SEG_A | SEG_D | SEG_E | SEG_F | SEG_G // E

TM1637Display display(CLK, DIO);
RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”};

void setup () {

#ifndef ESP8266
while (!Serial); // for Leonardo/Micro/Zero


delay(3000); // wait for console opening

if (! rtc.begin()) {
Serial.println(“Couldn’t find RTC”);
while (1);

if (rtc.lostPower()) {
Serial.println(“RTC lost power, lets set the time!”);
// following line sets the RTC to the date & time this sketch was compiled
//rtc.adjust(DateTime(F(DATE), F(TIME)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
//rtc.adjust(DateTime(2017, 8, 30, 14, 24, 0));

void loop () {
DateTime now =;

int k;
uint8_t data = { 0xff, 0xff, 0xff, 0xff };

int t = now.hour() * 100 + now.minute();
display.showNumberDec(t, true);

int d = now.month() * 100 +;
display.showNumberDec(d, true);

Serial.print(now.year(), DEC);
Serial.print(now.month(), DEC);
Serial.print(, DEC);
Serial.print(" (");
Serial.print(") ");
Serial.print(now.hour(), DEC);
Serial.print(now.minute(), DEC);
Serial.print(now.second(), DEC);


Did you install the RTClib.h library properly?

That’s not exactly what the error message says. Copy the entire error message from the bottom section of the IDE, and paste it BETWEEN CODE TAGS.

That said, what Larry says is the most likely problem.