Skip to content

deviceStart()

Arnd edited this page Jul 23, 2017 · 4 revisions

deviceStart();

This function will start the oscillator and has no effect if the oscillator is already running. It returns a boolean value as true if the oscillator was successfully started. A false is returned if the oscillator is not started as can be the case if the crystal is missing or the capacitors are not correctly specified. This function is also called automatically when adjust() is used.


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");
...
Clone this wiki locally