Skip to content

Class Instantiation

Arnd edited this page Dec 12, 2020 · 2 revisions

The DS1631 class has no parameters. It uses I2C where the 2 pins are predefined and the DS1631 has a fixed range of 8 possible I2C addresses. Instantiating the class does not check to see if the DS1631 is present, that is done as part of the begin() method.


Example:

DS1631_Class DS1631; // Create an instance of the DS1631
...
void setup() {
  Serial.begin(SERIAL_SPEED);
  while (!DS1631.begin()) { // Initialize I2C communications
    Serial.println("Unable to find DS1631. Checking again in 3 seconds.");
    delay(3000);
  } // of loop until device is located
...
} // of setup
Clone this wiki locally