Skip to content

Glitch-free Digital output pin initialization? #35

@tve

Description

@tve

How can I perform a glitch free initialization?
Example: I have a digital I/O pin that is in input mode, that reads high, and I need to turn it into an output pin that is high without causing any glitch to low. I'm probably missing something, but the only option I have is:

ioPin = new Digital({pin: pin_number, mode: Digital.output})
ioPin.write(1)

However, this may cause the pin to be briefly initialized to 0 and only afterwards driven high.
To solve this, the pattern I'm familiar with is to be able to pass an initial value into the constructor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions