Is there a Library available for using a Real Time Clock shield

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
amatilda
Posts: 68
Joined: 26 Sep 2021 22:09

Re: Is there a Library available for using a Real Time Clock shield

Post by amatilda »

Hello.
Let's try to get more information.

Use this sketch and post the error log:

Code: Select all

#include "Arduino.h"
#include "Wire.h"
#include <ZUNO_DS3232RTC.h>
#include <Time.h>


#define MY_SERIAL Serial


DS3232RTC myRTC;

tmElements_t te, te_r;

time_t ts; // secs since 1900.

void setup() {
	MY_SERIAL.begin(9600);
	te.Second = 30;
	te.Minute = 32;
	te.Hour = 13;
	te.Wday = 6;
	te.Day = 8;
	te.Month = 6-1;
	te.Year = 2024 -1900;
	myRTC.write(&te);
}

void loop() {
	if (myRTC.read(&te_r) != WIRE_ERORR_TRANSMISSION_SUCCESS) {
		MY_SERIAL.print("myRTC.read - error\n");
	}
	disp();
	delay(10000);
}

void disp(void){
	MY_SERIAL.print("dump: ");
	MY_SERIAL.dumpPrint(&te_r, sizeof(te_r), sizeof(te_r));
	MY_SERIAL.printf("\n*************\n%04d-%02d-%02d %02d:%02d:%02d : Weekday = %d.\n", te_r.Year + 1900, te_r.Month + 1, te_r.Day, te_r.Hour, te_r.Minute, te_r.Second, te_r.Wday);
}
KGBEl
Posts: 47
Joined: 21 Feb 2023 00:37

Re: Is there a Library available for using a Real Time Clock shield

Post by KGBEl »

Hi, it compiles and loads without any problems but only gives
????????????????????...
as output and all led:s on Z-uno is off.

How do I do to invoke the white area that containes code and starts with: "CODE: SELECT ALL"?
amatilda
Posts: 68
Joined: 26 Sep 2021 22:09

Re: Is there a Library available for using a Real Time Clock shield

Post by amatilda »

Hi, it compiles and loads without any problems but only gives
????????????????????...
as output and all led:s on Z-uno is off.
Do you have a card adapter to connect to the TX0 pin?
How do I do to invoke the white area that containes code and starts with: "CODE: SELECT ALL"?
Sorry, but I didn't quite understand, can you give me more details?
KGBEl
Posts: 47
Joined: 21 Feb 2023 00:37

Re: Is there a Library available for using a Real Time Clock shield

Post by KGBEl »

1:
I don't know what you mean by cardadapter to TX0, is there any dokumentation you can
show me about that?
I guess it has something to do with writing errors to som sort of USB or so?

2:
About the area where you copied all code to, where you can, at top of the area you can
select to mark all code.

Start:
Code: Select all

#include "Arduino.h"
#include "Wire.h"
#include <ZUNO_DS3232RTC.h>
#include <Time.h>


#define MY_SERIAL Serial
....
and so on till the end of the program.
amatilda
Posts: 68
Joined: 26 Sep 2021 22:09

Re: Is there a Library available for using a Real Time Clock shield

Post by amatilda »

About the area where you copied all code to, where you can, at top of the area you can
select to mark all code.
Use:
2024-08-20 164023.png
2024-08-20 164023.png (1.36 KiB) Viewed 6679 times
amatilda
Posts: 68
Joined: 26 Sep 2021 22:09

Re: Is there a Library available for using a Real Time Clock shield

Post by amatilda »

I don't know what you mean by cardadapter to TX0, is there any dokumentation you can
show me about that?
I meant something like that: https://www.amazon.com/Micro-SATA-Cable ... 43&sr=8-16
I guess it has something to do with writing errors to som sort of USB or so?
Unlikely
KGBEl
Posts: 47
Joined: 21 Feb 2023 00:37

Re: Is there a Library available for using a Real Time Clock shield

Post by KGBEl »

Thank you very much for the area tip.

About TX0-issue:
1. What is the serial converter good for?
2. How do I use it?
3. Are there any cheaper alternatives? 845$ is a lot of money.
User avatar
PoltoS
Posts: 7624
Joined: 26 Jan 2011 19:36

Re: Is there a Library available for using a Real Time Clock shield

Post by PoltoS »

They usually cost 5-10 EUR on Amazon or 1-5 on AliExpress. You can connect the Z-Uno debug output you PC USB port.

Search for CP2102 or "USB to Serial"
KGBEl
Posts: 47
Joined: 21 Feb 2023 00:37

Re: Is there a Library available for using a Real Time Clock shield

Post by KGBEl »

Ok, I understand what it is for, can you give me a link to some place where I can read
about it and understand it better.
Is it possible to find anything in this forum?

I am using Mac, does it differ from PC in this case?
lanbrown
Posts: 354
Joined: 01 Jun 2021 08:06

Re: Is there a Library available for using a Real Time Clock shield

Post by lanbrown »

KGBEl wrote:
21 Aug 2024 16:34
3. Are there any cheaper alternatives? 845$ is a lot of money.
It isn't $845.

You want to buy the USB 2.0 to TTL UART 6PIN Module Serial Converter CP2102, not the other device listed at the top which is an ad for a different device.

The device you want is $5.75.

https://electronics.stackexchange.com/q ... d-ttl-uart
Post Reply