You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project where a relay is used, the digital output must be used "inverted" to control the relay because "LOW" sets the relay and "HIGH" resets it. This results in this code:
Maybe it could be an idea to extend DigitalOutput in the library with an isInverted flag. But this would also mean all output methods have to take this flag into account.
The text was updated successfully, but these errors were encountered:
FDelporte
changed the title
Can a flag be added to define the polarity of a digital output
Can a flag be added to define the polarity of a digital output?
Apr 22, 2021
Yes, we really should add support for this. We added the methods on() and off() for convenience but in many cases on and off don't track with hi and low states.
If do think some form of inverted state configuration should be allowed that only applies to the on(), isOn(), off() and isOff() methods. The high and low states should always be explicit and concrete in meaning but on and off can be relative to the specific hardware implementation.
In a project where a relay is used, the digital output must be used "inverted" to control the relay because "LOW" sets the relay and "HIGH" resets it. This results in this code:
Maybe it could be an idea to extend DigitalOutput in the library with an
isInverted
flag. But this would also mean all output methods have to take this flag into account.The text was updated successfully, but these errors were encountered: