User Tools

Site Tools


en-us_commands:reference:irtc32khz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en-us_commands:reference:irtc32khz [2026/09/07 23:35] – 바깥 편집 127.0.0.1en-us_commands:reference:irtc32khz [2026/09/14 20:30] (current) – external edit 127.0.0.1
Line 14: Line 14:
  
 ===== Example ===== ===== Example =====
 +
 +This example connects a DS3231 RTC module to the MPINO-16A8R8T I²C port. The RTC's 32 kHz and square-wave outputs use different pins.
  
 <code cpp> <code cpp>
 void setup() { void setup() {
   Serial.begin(115200);   Serial.begin(115200);
-  if (!IrtcBegin()) return;  // Check the DS3231 RTC connection and begin operation. +  if (!IrtcBegin())  // Check the DS3231 connection and start the RTC. 
-  IrtcSquareWave(true, IRTC_SQUARE_WAVE_1HZ);  // Set the RTC square-wave output+    Serial.println(F("DS3231 not found")); 
-  Irtc32kHz(true);  // Enable or disable the RTC 32kHz output. +    return;
-+
- +
-void loop() { +
-  if (Iup(0, IdigitalRead(0, 5))) {  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state. / Return true only at the instant the input changes from OFF to ON. +
-    IrtcSquareWave(false);  // Set the RTC square-wave output. +
-    Irtc32kHz(false) // Enable or disable the RTC 32kHz output.+
   }   }
 +  const bool configured = Irtc32kHz(true);  // Enable the RTC's 32 kHz output pin.
 +  Serial.println(configured ? F("Output enabled") : F("RTC setup failed"));
 } }
 +
 +void loop() {}
 </code> </code>
  
Line 34: Line 34:
  
 Run each device's corresponding ''Begin'' command first. Check I²C addresses and pin sharing; if the ''bool'' return value is ''false'', inspect wiring and power. Run each device's corresponding ''Begin'' command first. Check I²C addresses and pin sharing; if the ''bool'' return value is ''false'', inspect wiring and power.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:irtcbegin|IrtcBegin() View detailed description]]
 +  * [[:en-us_commands:reference:irtcread|IrtcRead() View detailed description]]
 +  * [[:en-us_commands:reference:irtcset|IrtcSet() View detailed description]]
 +  * [[:en-us_commands:reference:irtcunixtime|IrtcUnixTime() View detailed description]]
 +  * [[:en-us_commands:reference:irtcgettemperature|IrtcGetTemperature() View detailed description]]
 +  * [[:en-us_commands:reference:irtctimevalid|IrtcTimeValid() View detailed description]]
 +  * [[:en-us_commands:reference:irtcclearoscillatorstopflag|IrtcClearOscillatorStopFlag() View detailed description]]
 +  * [[:en-us_commands:reference:irtcsetalarm1|IrtcSetAlarm1() View detailed description]]
 +  * [[:en-us_commands:reference:irtcsetalarm2|IrtcSetAlarm2() View detailed description]]
 +  * [[:en-us_commands:reference:irtcalarmenable|IrtcAlarmEnable() View detailed description]]
 +  * [[:en-us_commands:reference:irtcalarmenabled|IrtcAlarmEnabled() View detailed description]]
 +  * [[:en-us_commands:reference:irtcalarmtriggered|IrtcAlarmTriggered() View detailed description]]
 +  * [[:en-us_commands:reference:irtcsquarewave|IrtcSquareWave() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/irtc32khz.1788791734.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki