-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PCF8523 and lot of fixes.
- Loading branch information
Showing
27 changed files
with
1,251 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
.vscode/c_cpp_properties.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS1307 RTC; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...S1307/DS1307_M_Adjust/DS1307_M_Adjust.ino → ...es/DS1307/DS1307_Manual/DS1307_Manual.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS1307 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static NVRAM NVRAM; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static NVRAM NVRAM; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static NVRAM NVRAM; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
/* | ||
LOW 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS3231 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS3231 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS3231 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static DS3231 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
#include <Wire.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8523 RTC; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
RTC.begin(); | ||
|
||
//RTC.stopClock(); | ||
|
||
Serial.print("Is Clock Running: "); | ||
if (RTC.isRunning()) | ||
{ | ||
Serial.println("Yes"); | ||
Serial.print(RTC.getDay()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getMonth()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getYear()); | ||
Serial.print(" "); | ||
Serial.print(RTC.getHours()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getMinutes()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getSeconds()); | ||
Serial.print(""); | ||
if (RTC.getHourMode() == CLOCK_H12) | ||
{ | ||
switch (RTC.getMeridiem()) { | ||
case HOUR_AM: | ||
Serial.print(" AM"); | ||
break; | ||
case HOUR_PM: | ||
Serial.print(" PM"); | ||
break; | ||
} | ||
} | ||
Serial.println(""); | ||
delay(1000); | ||
} | ||
else | ||
{ | ||
delay(200); | ||
|
||
Serial.println("No"); | ||
Serial.println("Setting Time"); | ||
RTC.setHourMode(CLOCK_H12); | ||
//RTC.setHourMode(CLOCK_H24); | ||
RTC.setDateTime(__DATE__, __TIME__); | ||
Serial.println("New Time Set"); | ||
Serial.print(__DATE__); | ||
Serial.print(" "); | ||
Serial.println(__TIME__); | ||
RTC.startClock(); | ||
} | ||
} | ||
|
||
void loop() | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <Wire.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8523 RTC; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
RTC.begin(); | ||
|
||
Serial.println(); | ||
Serial.println("*** RTC PCF8523 ***"); | ||
Serial.print("Is Clock Running : "); | ||
if (RTC.isRunning()) | ||
Serial.println("Yes"); | ||
else | ||
Serial.println("No"); | ||
/* | ||
Serial.print("Battery Status : "); | ||
if (RTC.isBatteryLow()) | ||
Serial.println("Low"); | ||
else | ||
Serial.println("Good"); | ||
*/ | ||
//RTC.set | ||
|
||
} | ||
|
||
void loop() | ||
{ | ||
|
||
Serial.print(RTC.getDay()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getMonth()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getYear()); | ||
|
||
Serial.print(" "); | ||
|
||
Serial.print(RTC.getHours()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getMinutes()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getSeconds()); | ||
Serial.println(" "); | ||
|
||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
|
||
static PCF8523 RTC; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
RTC.begin(); | ||
|
||
RTC.setHourMode(CLOCK_H12); | ||
//RTC.setHourMode(CLOCK_H24); | ||
|
||
|
||
|
||
RTC.setDay(22); | ||
RTC.setMonth(5); | ||
RTC.setYear(2020); | ||
|
||
RTC.setHours(28); | ||
RTC.setMinutes(47); | ||
RTC.setSeconds(56); | ||
|
||
RTC.setWeek(1); | ||
|
||
//RTC.setDate(22,07,29); | ||
//RTC.setTime(22,10,20); | ||
|
||
if (RTC.getHourMode() == CLOCK_H12) | ||
{ | ||
//RTC.setMeridiem(HOUR_AM); | ||
} | ||
} | ||
|
||
void loop() | ||
{ | ||
|
||
switch (RTC.getWeek()) | ||
{ | ||
case 1: | ||
Serial.print("SUN"); | ||
break; | ||
case 2: | ||
Serial.print("MON"); | ||
break; | ||
case 3: | ||
Serial.print("TUE"); | ||
break; | ||
case 4: | ||
Serial.print("WED"); | ||
break; | ||
case 5: | ||
Serial.print("THU"); | ||
break; | ||
case 6: | ||
Serial.print("FRI"); | ||
break; | ||
case 7: | ||
Serial.print("SAT"); | ||
break; | ||
} | ||
Serial.print(" "); | ||
Serial.print(RTC.getDay()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getMonth()); | ||
Serial.print("-"); | ||
Serial.print(RTC.getYear()); | ||
|
||
Serial.print(" "); | ||
|
||
Serial.print(RTC.getHours()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getMinutes()); | ||
Serial.print(":"); | ||
Serial.print(RTC.getSeconds()); | ||
Serial.print(" "); | ||
|
||
if (RTC.getHourMode() == CLOCK_H12) | ||
{ | ||
if(RTC.getMeridiem() == HOUR_AM) | ||
Serial.println(" AM"); | ||
if (RTC.getMeridiem() == HOUR_PM) | ||
Serial.println(" PM"); | ||
} | ||
delay(1000); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8563 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8563 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8563 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <Wire.h> | ||
#include <RTC.h> | ||
#include <I2C_RTC.h> | ||
|
||
static PCF8563 RTC; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.