Hi, I´m Marta, a college student that has never done anything with electronics or programming BUT I´ve always wanted to try at it. So, I´m doing a project for college that consists of a lamp that imitates a sunrise to wake you up easier, but to do so i have to program the arduino uno i just got with an RTC DS3231 that wont work properly.
The problem: the rtc DS3231 will not work no matter how many tutorials and libraries I try to use. Rn I´m using the one from here: http://www.rinkydinkelectronics.com/library.php?id=73
I´ve downloaded it, opened arduino IDE and uploaded the zip library, and when i open the example to set the serial time, edit it and upload it, the serial monitor shows the date once when uploaded and then this: ϊ⸮Friday 12.11.2021 -- 21:46:10
⸮⸮X⸮⸮⸮⸮⸮⸮X⸮⸮X⸮⸮X⸮⸮⸮"⸮['⸮⸮⸮X⸮⸮X⸮⸮⸮⸮⸮ ⸮['⸮Y'⸮⸮⸮Y⸮⸮X⸮⸮⸮&⸮0iX⸮⸮X⸮⸮⸮&⸮⸮⸮⸮⸮X⸮⸮X⸮⸮['⸮['⸮0iX⸮⸮⸮⸮Y%⸮⸮&⸮⸮"⸮5⸮⸮⸮Y-⸮Y-⸮ ⸮⸮⸮Y'⸮Y-⸮Y-⸮⸮⸮5⸮['⸮Y'⸮['⸮⸮⸮⸮⸮⸮Y'⸮ ⸮Y-⸮5⸮X⸮⸮X⸮⸮['⸮X⸮⸮⸮⸮⸮⸮X⸮⸮⸮⸮Y-⸮['⸮ ⸮ ⸮⸮Y'⸮Y-⸮⸮⸮ ⸮Y⸮⸮⸮⸮⸮⸮X⸮⸮X⸮⸮Y%⸮⸮⸮⸮⸮⸮⸮⸮⸮"⸮ ⸮0iX⸮⸮Y-⸮⸮"⸮X⸮⸮Y-⸮⸮⸮⸮⸮X⸮⸮⸮&⸮Y-⸮X⸮⸮X⸮⸮X⸮⸮Y%⸮X⸮⸮⸮⸮5⸮['⸮Y-⸮X⸮⸮Y⸮⸮Y-⸮ ⸮⸮⸮X⸮⸮X⸮⸮⸮⸮⸮"⸮⸮&⸮Y'⸮X⸮⸮⸮"⸮['⸮⸮"⸮ ⸮['⸮⸮⸮⸮⸮⸮"⸮⸮⸮ ⸮⸮"⸮⸮⸮Y%⸮⸮⸮0aX⸮⸮Y%⸮X⸮⸮X⸮⸮⸮⸮⸮Y'⸮['⸮X⸮⸮['⸮ ⸮5⸮⸮⸮⸮⸮⸮⸮X⸮⸮X⸮⸮⸮⸮0a⸮⸮
this is the example when opened:
`// DS3231_Serial_Easy
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// A quick demo of how to use my DS3231-library to
// quickly send time and date information over a serial link
//
// To use the hardware I2C (TWI) interface of the Arduino you must connect
// the pins as follows:
//
// Arduino Uno/2009:
// ----------------------
// DS3231: SDA pin -> Arduino Analog 4 or the dedicated SDA pin
// SCL pin -> Arduino Analog 5 or the dedicated SCL pin
//
// Arduino Leonardo:
// ----------------------
// DS3231: SDA pin -> Arduino Digital 2 or the dedicated SDA pin
// SCL pin -> Arduino Digital 3 or the dedicated SCL pin
//
// Arduino Mega:
// ----------------------
// DS3231: SDA pin -> Arduino Digital 20 (SDA) or the dedicated SDA pin
// SCL pin -> Arduino Digital 21 (SCL) or the dedicated SCL pin
//
// Arduino Due:
// ----------------------
// DS3231: SDA pin -> Arduino Digital 20 (SDA) or the dedicated SDA1 (Digital 70) pin
// SCL pin -> Arduino Digital 21 (SCL) or the dedicated SCL1 (Digital 71) pin
//
// The internal pull-up resistors will be activated when using the
// hardware I2C interfaces.
//
// You can connect the DS3231 to any available pin but if you use any
// other than what is described above the library will fall back to
// a software-based, TWI-like protocol which will require exclusive access
// to the pins used, and you will also have to use appropriate, external
// pull-up resistors on the data and clock signals.
//
#include <DS3231.h>
// Init the DS3231 using the hardware interface
DS3231 rtc(SDA, SCL);
void setup()
{
// Setup Serial connection
Serial.begin(115200);
// Uncomment the next line if you are using an Arduino Leonardo
//while (!Serial) {}
// Initialize the rtc object
rtc.begin();
// The following lines can be uncommented to set the date and time
rtc.setDOW(FRIDAY); // Set Day-of-Week to SUNDAY
rtc.setTime(21, 46, 10); // Set the time to 12:00:00 (24hr format)
rtc.setDate(12, 11, 2021); // 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
delay (1000);
}`
somebody please help me, and guide me through step by step to make it work.
THANK YOU <3!!!