Skip to content

deviceStart()

Arnd edited this page Dec 11, 2020 · 4 revisions

This function will start the oscillator return the boolean state of the MCP7940 after starting; the value will be false if the oscillator could not be started. The function has no effect if the oscillator is already running. Problems with starting should only occur if the crystal is missing or defective or the capacitors are not correctly specified. The other method to start the MCP7940 is to use the adjust() function.


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 on oscillator.");
  if(!MCP7940.deviceStart) Serial.println("Error, unable to start oscillator");
...
} // of setup
Clone this wiki locally