====== IrtcSquareWave() ====== ''IrtcSquareWave()'' configures the RTC square-wave output. {{:en-us_commands:reference:irtcsquarewave.svg?900|IrtcSquareWave command operation flow}} ''bool IrtcSquareWave(bool enable, uint8_t frequency = IRTC_SQUARE_WAVE_1HZ, bool batteryPowered = false)'' ===== Commands ===== ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ''IrtcSquareWave(enable, frequency, batteryPowered)'' | ''bool enable''\\ ''uint8_t frequency = IRTC_SQUARE_WAVE_1HZ''\\ ''bool batteryPowered = false'' | ''bool'' | Configures the RTC square-wave output. | ===== 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. void setup() { Serial.begin(115200); if (!IrtcBegin()) { // Check the DS3231 connection and start the RTC. Serial.println(F("DS3231 not found")); 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() {} ===== Precautions ===== 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]]