-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclock.h
37 lines (29 loc) · 1.47 KB
/
clock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <Arduino.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// configure your time zone specifics here, the clock runs UTC
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//#define CLOCK_DS1307
#define CLOCK_DS3231
const int TimeZoneSTD = 1; //UTC+1 CET
const int TimeZoneDST = 2; //UTC+2 CEST
const int DSTYearOfs = 2017; //starting year of the array below
const int DSTBegin [] PROGMEM = { 326, 325, 331, 329, 328, 327, 326}; //month*100+day
const int DSTEnd [] PROGMEM = {1029,1028,1027,1025,1031,1030,1029};
const int DS18B20_PIN = -1; // DS18B20 temperature sensor, -1 if not installed
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#if defined(CLOCK_DS1307)
#include <MD_DS1307.h>
#elif defined(CLOCK_DS3231)
#include <MD_DS3231.h>
#endif
const char *p2dig(uint8_t v, uint8_t mode);
char htoa(uint8_t i);
uint8_t htoi(char c);
void RTC_Init();
void RTC_ReadTime_Local();
void RTC_ReadTime_UTC();
void RTC_WriteTime_UTC(int yyyy,int mm, int dd, int h, int m, int s);
float Temp_Read();