Error with code

#include <DS3231.h>
#include <wire.h>

void setup();
Serial.begin(115200);

// Initialize the rtc object
rtc.begin();
rtc.setDOW(SUNDAY); // Set Day-of-Week to SUNDAY
rtc.setTime(12, 0, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(1, 1, 2024); // Set the date to January 1st, 2014
}

void loop()
{
// Send Day-of-Week
Serial.print(rtc.getDOWStr());
Serial.print(" ");

// Send date
Serial.print(rtc.getDateStr());
Serial.print(" -- ");

// Send time
Serial.println(rtc.getTimeStr());

// Wait one second before repeating :slight_smile:
delay (1000);
}

please help me

Do not bump your thread. You waited one minute.

While you are waiting... you should re-format and put your code into a "code block"... to do this, (1) edit your post (2) select and CUT your code out (3) reformat your code in your IDE (CTRL-T) and select/cut your code from your IDE (4) inside your message, click the <CODE> button (5) where you see ```type or paste code here``` select the words (type or paste code here) and PASTE your formatted code. You should have something that looks like this:

void setup() {
  Serial.begin(115200);
}

void loop() {
  delay(1000);
  Serial.print(millis() / 1000);
}

Your turn...

UPPER case "w" in Wire.

And this should be

void setup() { // no close brace or semi-colon

I missed this, too... you need to declare an object for your library... somehthing like...

DS3231  rtc(SDA, SCL);

Salamat.

You might want to look at this How to get the best out of this forum before you proceed any further.
We only know what you tell us, and without knowing what you have, we don't stand a chance.

You are not even telling us what sort of Arduino you have! Which is the very first thing we need to know before we can try and compile it our selves.

It will also help if you post the full error message (using code tags as described by @xfpd).

C++ is case sensitive, it should be #include <Wire.h>.


This is not an IDE problem; topic moved to a more suitable location on the forum.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.