제조사 | OEM |
---|---|
브랜드 | 에듀이노 |
판매가 | 4,800원 |
적립금 | 40원 |
자체상품코드 | D-91 |
상품요약정보 | DS1302 |
국내·해외배송 | 국내배송 |
배송방법 | 택배 |
수량 |
COMMENT |
(최소주문수량 1개 이상 / 최대주문수량 0개 이하)
사이즈 가이드
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101 |
// CONNECTIONS:
// DS1302 CLK/SCLK --> 5
// DS1302 DAT/IO --> 4
// DS1302 RST/CE --> 2
// DS1302 VCC --> 3.3v - 5v
// DS1302 GND --> GND
#include <ThreeWire.h>
#include <RtcDS1302.h>
ThreeWire myWire(4,5,2); // IO, SCLK, CE
RtcDS1302<ThreeWire> Rtc(myWire);
void setup ()
{
Serial.begin(57600);
Serial.print("compiled: ");
Serial.print(__DATE__);
Serial.println(__TIME__);
Rtc.Begin();
RtcDateTime compiled = RtcDateTime(__DATE__, __TIME__);
printDateTime(compiled);
Serial.println();
if (!Rtc.IsDateTimeValid())
{
// Common Causes:
// 1) first time you ran and the device wasn't running yet
// 2) the battery on the device is low or even missing
Serial.println("RTC lost confidence in the DateTime!");
Rtc.SetDateTime(compiled);
}
if (Rtc.GetIsWriteProtected())
{
Serial.println("RTC was write protected, enabling writing now");
Rtc.SetIsWriteProtected(false);
}
if (!Rtc.GetIsRunning())
{
Serial.println("RTC was not actively running, starting now");
Rtc.SetIsRunning(true);
}
RtcDateTime now = Rtc.GetDateTime();
if (now < compiled)
{
Serial.println("RTC is older than compile time! (Updating DateTime)");
Rtc.SetDateTime(compiled);
}
else if (now > compiled)
{
Serial.println("RTC is newer than compile time. (this is expected)");
}
else if (now == compiled)
{
Serial.println("RTC is the same as compile time! (not expected but all is fine)");
}
}
void loop ()
{
RtcDateTime now = Rtc.GetDateTime();
printDateTime(now);
Serial.println();
if (!now.IsValid())
{
// Common Causes:
// 1) the battery on the device is low or even missing and the power line was disconnected
Serial.println("RTC lost confidence in the DateTime!");
}
delay(1000); // ten seconds
}
#define countof(a) (sizeof(a) / sizeof(a[0]))
void printDateTime(const RtcDateTime& dt)
{
char datestring[20];
snprintf_P(datestring,
countof(datestring),
PSTR("%02u/%02u/%04u %02u:%02u:%02u"),
dt.Month(),
dt.Day(),
dt.Year(),
dt.Hour(),
dt.Minute(),
dt.Second() );
Serial.print(datestring);
}
|
cs |
상품의 사용후기를 작성해주세요.
글읽기 권한이 없습니다.
"19세 미만의 미성년자"는 출입을 금합니다!
no | photo | title | write | date | hit | point |
---|---|---|---|---|---|---|
1 | 배송도 빠르고 좋아요! [1] | 이**** | 2024-02-16 | 186 |
상품에 대해 궁금한 점을 해결해 드립니다.
글읽기 권한이 없습니다.
"19세 미만의 미성년자"는 출입을 금합니다!
no | category | title | write | date | hit |
---|---|---|---|---|---|
4 | 핀번호를 변경할수있나요. [1] | uvbus | 2023-01-04 | 382 | |
3 | 핀번호를 변경할수있나요. [1] | 2023-01-05 | 410 | ||
2 | rtc 모듈에 대해 문의드립니다. [1] | 김근욱 | 2022-11-30 | 522 | |
1 | RTC 모듈 다른 것도 팔아주세요 | 29180791@n | 2022-03-19 | 127 |