User Tools

Site Tools


en-us_commands:reference:irtcsquarewave

Differences

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

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:irtcsquarewave [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:irtcsquarewave [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() {
-  if (!IrtcBegin()) return; +  Serial.begin(115200); 
- +  if (!IrtcBegin()) {  // Check the DS3231 connection and start the RTC. 
-  // Output a 1Hz square wave on the INT/SQW terminal+    Serial.println(F("DS3231 not found")); 
-  IrtcSquareWave(true, IRTC_SQUARE_WAVE_1HZ);+    return; 
 +  } 
 +  const bool configured = IrtcSquareWave(true, IRTC_SQUARE_WAVE_1HZ);  // Output a 1 Hz square wave on the RTC SQW pin
 +  Serial.println(configured ? F("Output enabled") : F("RTC setup failed"));
 } }
  
-void loop() { +void loop() {}
-}+
 </code> </code>
  
Line 30: 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:irtc32khz|Irtc32kHz() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/irtcsquarewave.1788785568.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki