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
According to the SX1509 datasheet, digital outputs default to high on initialization. This is the opposite of what's typically expected for Arduino outputs. With the current library setup, it appears impossible to avoid this, as performing a digitalWrite prior to setting a pin as an output changes the pullup/pulldown settings instead of the RegData register value. Ideally, there would be a way to specify the initial value prior to enabling an output. I see several possible solutions:
Support an optional extra argument to pinMode to specify starting output level.
Add a separate function to specify default output level, to be called prior to setting a pin as an output.
Check the pullup/pulldown state to determine initial output state, allowing setting of initial output level by setting pullup/pulldown state prior to pin direction change.
Change to default low on startup by always writing bit in RegData to low whenever about to set a pin as an output, to match Arduino behavior (however, this might cause unexpected behavior for previous scripts using the library)
The text was updated successfully, but these errors were encountered:
According to the SX1509 datasheet, digital outputs default to high on initialization. This is the opposite of what's typically expected for Arduino outputs. With the current library setup, it appears impossible to avoid this, as performing a
digitalWrite
prior to setting a pin as an output changes the pullup/pulldown settings instead of theRegData
register value. Ideally, there would be a way to specify the initial value prior to enabling an output. I see several possible solutions:RegData
to low whenever about to set a pin as an output, to match Arduino behavior (however, this might cause unexpected behavior for previous scripts using the library)The text was updated successfully, but these errors were encountered: