Skip to content

deviceStop()

Arnd edited this page Aug 6, 2017 · 3 revisions

This function will stop the oscillator and has no effect if the oscillator is already stopped. The optional boolean return value is set to the state of the oscillator after this function; it will return true only if the oscillator could not be stopped and is still running.


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
  Serial.println("Turning off oscillator.");
  if(MCP7940.deviceStop) Serial.println("Error, unable to stop oscillator");
...