Skip to content

Commit fe7f8d3

Browse files
author
Main Push Robot
committed
Committing dev changes
1 parent 14148dd commit fe7f8d3

File tree

5 files changed

+69
-54
lines changed

5 files changed

+69
-54
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
# PCF85063A Arduino library
1+
# Real time clock RTC PCF85063A breakout Arduino library
22

3-
[![Compile Sketches](http://github-actions.40ants.com/e-radionicacom/Soldered-PCF85063A-Arduino-Library/matrix.svg?branch=dev&only=Compile%20Sketches)](https://github.com/e-radionicacom/Soldered-PCF85063A-Arduino-Library/actions/workflows/compile_test.yml)
4-
[![Make docs and publish to GitHub Pages](https://github.com/e-radionicacom/Soldered-PCF85063A-Arduino-Library/actions/workflows/make_docs.yml/badge.svg?branch=dev)](https://github.com/e-radionicacom/Soldered-PCF85063A-Arduino-Library/actions/workflows/make_docs.yml)
3+
[![Compile Sketches](http://github-actions.40ants.com/e-radionicacom/Soldered-PCF85063A-RTC-Module-Arduino-Library/matrix.svg?branch=dev&only=Compile%20Sketches)](https://github.com/e-radionicacom/Soldered-PCF85063A-RTC-Module-Arduino-Library/actions/workflows/compile_test.yml)
4+
[![Make docs and publish to GitHub Pages](https://github.com/e-radionicacom/Soldered-PCF85063A-RTC-Module-Arduino-Library/actions/workflows/make_docs.yml/badge.svg?branch=dev)](https://github.com/e-radionicacom/Soldered-PCF85063A-RTC-Module-Arduino-Library/actions/workflows/make_docs.yml)
55

6-
| ![PCF85063A Soldered Board](https://upload.wikimedia.org/wikipedia/commons/8/8f/Example_image.svg) |
6+
| ![Real time clock RTC PCF85063A breakout Board](https://upload.wikimedia.org/wikipedia/commons/8/8f/Example_image.svg) |
77
| :---------------------------------------------------------------------------------------------: |
8-
| [PCF85063A Soldered Board](https://www.solde.red/333051) |
8+
| [Real time clock RTC PCF85063A breakout Board](https://www.solde.red/333051) |
99

10-
PCF85063A RTC Board from Soldered, compliant to [easyC ecosystem](https://www.soldered.com/easyC).
10+
Real time clock PCF85063A breakout board compliant to [easyC ecosystem](https://www.soldered.com/easyC).
1111

1212
### Repository Contents
1313
- **/src** - source files for the library (.h & .cpp)
1414
- **/examples** - examples for using the library
1515
- ***other*** - *keywords* file highlights function words in your IDE, *library.properties* enables implementation with Arduino Library Manager.
1616

1717
### Hardware design
18-
You can find hardware design for this board in PCF85063A Board hardware repository
18+
You can find hardware design for this board in Real time clock PCF85063A breakout Board hardware repository
1919

2020
### Documentation
2121

22-
Access Arduino library documentation [here](https://e-radionicacom.github.io/Soldered-PCF85063A-Arduino-Library/).
22+
Access Arduino library documentation [here](https://e-radionicacom.github.io/Soldered-PCF85063A-RTC-Module-Arduino-Library/).
2323

24-
- Tutorial for using the PCF85063A board
24+
- Tutorial for using the Real time clock PCF85063A breakout board
2525
- Installing an Arduino library
2626

2727
### About Soldered
28-
![Soldered logo](https://raw.githubusercontent.com/e-radionicacom/Soldered-PCF85063A-Arduino-Library/dev/extras/Logo%20horizontal-2.svg)
28+
![Soldered logo](https://raw.githubusercontent.com/e-radionicacom/Soldered-PCF85063A-RTC-Module-Arduino-Library/dev/extras/Logo%20horizontal-2.svg)
2929

3030
At Soldered, we design and manufacture a wide selection of electronic products to help you turn your ideas into acts and bring you one step closer to your final project. Our products are intented for makers and crafted in-house by our experienced team in Osijek, Croatia. We believe that sharing is a crucial element for improvement and innovation, and we work hard to stay connected with all our makers regardless of their skill or experience level. Therefore, all our products are open-source. Finally, we always have your back. If you face any problem concerning either your shopping experience or your electronics project, our team will help you deal with it, offering efficient customer service and cost-free technical support anytime. Some of those might be useful for you:
3131

examples/Alarm_Interrupt_Sleep_Example/Alarm_Interrupt_Sleep_Example.ino

+30-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @file Alarm_Interrupt_Sleep_Example.ino
55
* @brief Example for Alarm Interrupted Sleep on the AVRs
66
*
7-
*
7+
* Product: www.solde.red/333051
88
*
99
* @authors @ Zvonimir Haramustek for soldered.com.com
1010
***************************************************/
@@ -14,6 +14,12 @@
1414
#include <avr/sleep.h>
1515
#endif
1616

17+
#ifndef LED_BUILTIN // Some microcontroller boards doesnt have builtin LED
18+
// so compiler would send error message
19+
#define LED_BUILTIN 9 // It is possible to add LED instead of builtin and
20+
// attach to this pin
21+
#endif
22+
1723
PCF85063A rtc;
1824

1925
int wakePin = 2; // pin used for waking up
@@ -29,12 +35,16 @@ void wakeUpNow()
2935

3036
void setup()
3137
{
32-
Serial.begin(115200);
38+
Serial.begin(115200);
3339
rtc.begin();
3440

3541
pinMode(wakePin, INPUT_PULLUP);
42+
43+
3644
pinMode(LED_BUILTIN, OUTPUT);
3745

46+
47+
3848
// setTime(hour, minute, sec);
3949
rtc.setTime(6, 54, 00); // 24H mode, ex. 6:54:00
4050
// setDate(weekday, day, month, yr);
@@ -59,9 +69,10 @@ void loop()
5969

6070
void printCurrentTime()
6171
{
62-
switch (rtc.getWeekday())
72+
switch (rtc.getWeekday()) // Get weekday, 0 is Sunday
73+
// and decode to string
6374
{
64-
case 0:
75+
case 0:
6576
Serial.print("Sunday , ");
6677
break;
6778
case 1:
@@ -84,23 +95,24 @@ void printCurrentTime()
8495
break;
8596
}
8697

87-
Serial.print(rtc.getDay());
98+
Serial.print(rtc.getDay()); //Function for getting day in month
8899
Serial.print(".");
89-
Serial.print(rtc.getMonth());
100+
Serial.print(rtc.getMonth()); //Function for getting month
90101
Serial.print(".");
91-
Serial.print(rtc.getYear());
102+
Serial.print(rtc.getYear()); //Function for getting year
92103
Serial.print(". ");
93-
Serial.print(rtc.getHour());
104+
Serial.print(rtc.getHour()); //Function for getting hours
94105
Serial.print(":");
95-
Serial.print(rtc.getMinute());
106+
Serial.print(rtc.getMinute()); //Function for getting minutes
96107
Serial.print(":");
97-
Serial.println(rtc.getSecond());
108+
Serial.println(rtc.getSecond()); //Function for getting seconds
98109
}
99110

100111
void checkAlarm()
101112
{
102113
Serial.print("Alarm is set to match: ");
103-
switch (rtc.getAlarmWeekday())
114+
switch (rtc.getAlarmWeekday()) // Get weekday, when alarm
115+
// is set to
104116
{
105117
case 0:
106118
Serial.print("Sunday , ");
@@ -124,25 +136,25 @@ void checkAlarm()
124136
Serial.print("Saturday , ");
125137
break;
126138
default:
127-
break; // for getAlarmWeekday=99 alarm is not set for a weekday, donnot print
139+
break; // for getAlarmWeekday=99 alarm is not set for a weekday, do not print
128140
}
129141

130-
if (rtc.getAlarmDay() != 99)
142+
if (rtc.getAlarmDay() != 99) // Get month day, when alarm is set to
131143
{
132144
Serial.print("Date: ");
133145
Serial.print(rtc.getAlarmDay());
134146
}
135-
if (rtc.getAlarmHour() != 99)
147+
if (rtc.getAlarmHour() != 99) // Get hours, when alarm is set to
136148
{
137149
Serial.print(" hour: ");
138150
Serial.print(rtc.getAlarmHour());
139151
}
140-
if (rtc.getAlarmMinute() != 99)
152+
if (rtc.getAlarmMinute() != 99) // Get minutes, when alarm is set to
141153
{
142154
Serial.print(" minute: ");
143155
Serial.print(rtc.getAlarmMinute());
144156
}
145-
if (rtc.getAlarmSecond() != 99)
157+
if (rtc.getAlarmSecond() != 99) // Get seconds, when alarm is set to
146158
{
147159
Serial.print(" second: ");
148160
Serial.print(rtc.getAlarmSecond());
@@ -165,5 +177,6 @@ void sleepNow()
165177
#endif
166178

167179
// THE PROGRAM CONTINUES FROM HERE AFTER WAKING UP
180+
168181
digitalWrite(LED_BUILTIN, HIGH);
169-
}
182+
}

examples/Basic_Example/Basic_Example.ino

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
* @file Basic_Example.ino
55
* @brief Example for using PCF85063A Library
66
*
7-
*
7+
* Product: www.solde.red/333051
88
*
99
* @authors @ Zvonimir Haramustek for soldered.com.com
1010
***************************************************/
1111

1212
#include "PCF85063A-SOLDERED.h"
1313

14-
PCF85063A rtc;
14+
PCF85063A rtc;
1515

1616

1717
void setup()
1818
{
19-
Serial.begin(115200);
20-
rtc.begin();
19+
Serial.begin(115200); //Start serial communication with PC using 115200 baudrate
20+
rtc.begin(); //Initialize RTC module
2121

2222
// setTime(hour, minute, sec);
2323
rtc.setTime(6, 54, 00); // 24H mode, ex. 6:54:00
@@ -27,15 +27,16 @@ void setup()
2727

2828
void loop()
2929
{
30-
printCurrentTime();
30+
printCurrentTime(); //Call funtion printCurrentTime()
3131
delay(1000);
3232
}
3333

3434
void printCurrentTime()
3535
{
36-
switch (rtc.getWeekday())
36+
switch (rtc.getWeekday()) // Get weekday, 0 is Sunday
37+
// and decode to string
3738
{
38-
case 0:
39+
case 0:
3940
Serial.print("Sunday , ");
4041
break;
4142
case 1:
@@ -58,15 +59,15 @@ void printCurrentTime()
5859
break;
5960
}
6061

61-
Serial.print(rtc.getDay());
62+
Serial.print(rtc.getDay()); //Function for getting day in month
6263
Serial.print(".");
63-
Serial.print(rtc.getMonth());
64+
Serial.print(rtc.getMonth()); //Function for getting month
6465
Serial.print(".");
65-
Serial.print(rtc.getYear());
66+
Serial.print(rtc.getYear()); //Function for getting year
6667
Serial.print(". ");
67-
Serial.print(rtc.getHour());
68+
Serial.print(rtc.getHour()); //Function for getting hours
6869
Serial.print(":");
69-
Serial.print(rtc.getMinute());
70+
Serial.print(rtc.getMinute()); //Function for getting minutes
7071
Serial.print(":");
71-
Serial.println(rtc.getSecond());
72+
Serial.println(rtc.getSecond()); //Function for getting seconds
7273
}

examples/Timer_Example/Timer_Example.ino

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @file Timer_Example.ino
55
* @brief Example for using timer on the PCF85063A
66
*
7-
*
7+
* Product: www.solde.red/333051
88
*
99
* @authors @ Zvonimir Haramustek for soldered.com.com
1010
***************************************************/
@@ -17,8 +17,8 @@ uint8_t countdown_time = 5; // timer countdown in seconds
1717

1818
void setup()
1919
{
20-
Serial.begin(115200);
21-
rtc.begin();
20+
Serial.begin(115200); //Start serial communication with PC using 115200 baudrate
21+
rtc.begin(); //Initialize RTC module
2222

2323
// setTime(hour, minute, sec);
2424
rtc.setTime(6, 54, 00); // 24H mode, ex. 6:54:00
@@ -30,7 +30,7 @@ void setup()
3030

3131
void loop()
3232
{
33-
printCurrentTime();
33+
printCurrentTime(); //Call funtion printCurrentTime()
3434
Serial.print("Setting timer countdown, waking up in ");
3535
Serial.print(countdown_time);
3636
Serial.println(" seconds.");
@@ -51,7 +51,7 @@ void loop()
5151
rtc.timerSet(PCF85063A::TIMER_CLOCK_1HZ, countdown_time, false, false);
5252

5353
Serial.print("Waiting for a countdown");
54-
while (!rtc.checkTimerFlag())
54+
while (!rtc.checkTimerFlag()) // Check if timer finished countdown
5555
{
5656
Serial.print(".");
5757
delay(1000);
@@ -62,9 +62,10 @@ void loop()
6262

6363
void printCurrentTime()
6464
{
65-
switch (rtc.getWeekday())
65+
switch (rtc.getWeekday()) // Get weekday, 0 is Sunday
66+
// and decode to string
6667
{
67-
case 0:
68+
case 0:
6869
Serial.print("Sunday , ");
6970
break;
7071
case 1:
@@ -87,15 +88,15 @@ void printCurrentTime()
8788
break;
8889
}
8990

90-
Serial.print(rtc.getDay());
91+
Serial.print(rtc.getDay()); //Function for getting day in month
9192
Serial.print(".");
92-
Serial.print(rtc.getMonth());
93+
Serial.print(rtc.getMonth()); //Function for getting month
9394
Serial.print(".");
94-
Serial.print(rtc.getYear());
95+
Serial.print(rtc.getYear()); //Function for getting year
9596
Serial.print(". ");
96-
Serial.print(rtc.getHour());
97+
Serial.print(rtc.getHour()); //Function for getting hours
9798
Serial.print(":");
98-
Serial.print(rtc.getMinute());
99+
Serial.print(rtc.getMinute()); //Function for getting minutes
99100
Serial.print(":");
100-
Serial.println(rtc.getSecond());
101+
Serial.println(rtc.getSecond()); //Function for getting seconds
101102
}

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name=PCF85063A Soldered Library
1+
name= Soldered PCF85063A Library
22
version=1.0.0
33
author=Soldered
44
maintainer=Soldered <[email protected]>

0 commit comments

Comments
 (0)