Permit function to customize determination of current switch position for multi position switches
LatestBefore this release, each pin of a MultiPositionSwitch corresponded to exactly one switch position. However, there are switches that transmit their position in an already coded form. For these switches, the new function setFindSwitchPosition
function now allows to specify a function that reads the switch inputs and, in a customised way, returns the current switch position.
The specified function can use the following methods:
bool isPinOn(pinIndex)
: read the nth input pin. Considers activeHigh and activeLow and directly returns if the pin is in an "on" stateuint8_t getNumberOfPositions()
: returns the number of defined input pins