commands:reference:irtctimevalid
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| commands:reference:irtctimevalid [2026/09/01 20:04] – 만듦 - 바깥 편집 127.0.0.1 | commands:reference:irtctimevalid [2026/09/08 00:53] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 11: | 줄 11: | ||
| ^ 명령어 ^ 인수 ^ 반환값 ^ 동작 ^ | ^ 명령어 ^ 인수 ^ 반환값 ^ 동작 ^ | ||
| | '' | | '' | ||
| + | |||
| ===== 예제 ===== | ===== 예제 ===== | ||
| <code cpp> | <code cpp> | ||
| - | bool valid; | + | void setup() { |
| - | if (IrtcTimeValid(valid) && !valid) { | + | Serial.begin(115200); |
| - | // | + | if (!IrtcBegin()) return; |
| + | |||
| + | | ||
| + | if (IrtcTimeValid(valid) && !valid) { // RTC 시간이 신뢰 가능한 상태인지 | ||
| + | IrtcSet(2026, | ||
| + | IrtcClearOscillatorStopFlag(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | IrtcDateTime now; | ||
| + | uint32_t unixTime = 0; | ||
| + | float rtcTemperature = 0.0F; | ||
| + | if (IrtcRead(now) && IrtcUnixTime(unixTime) && IrtcGetTemperature(rtcTemperature)) { // RTC 내부 온도를 반환합니다. / 현재 시간을 Unix 시간으로 반환합니다. / RTC의 날짜와 시간을 읽습니다. | ||
| + | Serial.print(unixTime); | ||
| + | } | ||
| + | delay(1000); | ||
| } | } | ||
| </ | </ | ||
| 줄 24: | 줄 41: | ||
| 각 장치는 해당 '' | 각 장치는 해당 '' | ||
| + | |||
| + | ===== 같은 카테고리의 내장 명령어 ===== | ||
| + | |||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| [[commands: | [[commands: | ||
commands/reference/irtctimevalid.1788260661.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1
