Skip to content

setSQWState()

Arnd edited this page Dec 11, 2020 · 2 revisions

This function is used to turn the square wave output on the MFP pin to on or off. The speed of the square wave output is set using setSQWSpeed and retrieved using getSQWSpeed.


Example:

...
MCP7940_Class MCP7940; // Create an instance of the MCP7940
...
void setup() {
  Serial.begin(SERIAL_SPEED);
  while (!MCP7940.begin()) { // Initialize RTC communications
    Serial.println("Unable to find MCP7940. Checking again in 1 second.");
    delay(1000);
  } // of loop until device is located
 MCP7940.begin(); // start with compile date-time
 MCP7940.setSQWSpeed(2); // set SQW to 8192 Hz
 MCP7940.setSQWState(true); // turn on the square wave
 ...
 Serial.print("Square wave speed setting is ");
 Serial.println(MCP7940.getSQWSpeed());
...
Clone this wiki locally