0

I have a DS1302 RTC board (Waveshare) connected to an Arduino uno.

I'm printing time to Arduino's Serial Monitor but I get weird numbers/characters, and after 2-4 seconds it stops printing.

Wiring:

Vcc -> 5v

GND -> GND

I/O (MISO) -> Pin 12

SCLK -> Pin 13

CE (CS) -> Pin 10

Library used: VirtuabotixRTC library.

Things I've tried so far:

I tried a second DS1302 RTC board.

I tried a different Arduino board.

I tried changing the jumper wires.

I tried different baud rates.

Code:

#include <virtuabotixRTC.h>

virtuabotixRTC myRTC(7,8,9);

void setup() {

  Serial.begin(9600);
  //  myRTC.setDS1302Time(30,30,5,5,5,5,2020);
}

void loop() {
  myRTC.updateTime();
  Serial.print(myRTC.hours);
  Serial.print(":");
  Serial.print(myRTC.minutes);
  Serial.print(":");
  Serial.println(myRTC.seconds);
}

Screenshots: enter image description here

enter image description here enter image description here

BrainTrance
  • 79
  • 11

0 Answers0