BayEOSArduino Library
Functions
Using more than one SDI-12 Object

Functions needed for multiple instances of the SDI12 class. More...

Functions

bool SDI12::setActive ()
 Set this instance as the active SDI-12 instance. More...
 
bool SDI12::isActive ()
 Check if this instance is active. More...
 

Detailed Description

Functions needed for multiple instances of the SDI12 class.

This library is allows for multiple instances of itself running on the same or different pins. SDI-12 can support up to 62 sensors on a single pin/bus, so it is not necessary to use an instance for each sensor.

Because we are using pin change interrupts there can only be one active object at a time (since this is the only reliable way to determine which pin the interrupt occurred on). The active object is the only object that will respond properly to interrupts. However promoting another instance to Active status does not automatically remove the interrupts on the other pin. For proper behavior it is recommended to use this pattern:

mySDI12.forceHold();
myOtherSDI12.setActive();

Other notes:

Function Documentation

◆ isActive()

bool SDI12::isActive ( )

Check if this instance is active.

Returns
bool True indicates that the curren SDI-12 instace is the active one.

isActive() is a method for checking if the object is the active object. Returns true if the object is currently the active object, false otherwise.

◆ setActive()

bool SDI12::setActive ( )

Set this instance as the active SDI-12 instance.

Returns
bool True indicates that the current SDI-12 instance was not formerly the active one and now is. False indicates that the current SDI-12 instance is already the active one and the state was not changed.

A method for setting the current object as the active object; returns TRUE if the object was not formerly the active object and now is.

  • Promoting an inactive to the active instance will start it in the SDI12_HOLDING state and return TRUE.
  • Otherwise, if the object is currently the active instance, it will remain unchanged and return FALSE.