Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you initialize a pin to high? #38

Open
jfarago opened this issue Jan 31, 2016 · 3 comments
Open

How do you initialize a pin to high? #38

jfarago opened this issue Jan 31, 2016 · 3 comments
Assignees
Milestone

Comments

@jfarago
Copy link

jfarago commented Jan 31, 2016

I can initialize the pin and then set it high in the ready callback but for a split second it is pulled low.

@cagodoy
Copy link

cagodoy commented Mar 8, 2017

i think you should be use ready function.

const gpio4 = gpio.export(4, {
  direction: 'out',
  ready: () => {
    // sets pin to high in the first time
    gpio4.set()
  }
})

@jfarago
Copy link
Author

jfarago commented Mar 8, 2017

@cagodoy yes, that is what i ended up doing but its a poor solution as it toggles the gpio on restart.

@cinderblock
Copy link

cinderblock commented Nov 20, 2017

The sysfs gpio interface, that this library uses, supports what you want. All that is needed is to set direction to high.

Unfortunately, this library does not know about this option and forces direction to be either in or out.

It would be nice to see this fixed.

Also see #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants