GithubHelp home page GithubHelp logo

Comments (6)

fivdi avatar fivdi commented on June 12, 2024

I wanna init a gpio instance(pin direction set to 'out') without change it's pin status('low' or 'high'),

If I understand the requirement correctly, I would expect something like the following to work:

const Gpio = require('onoff').Gpio;
const led = new Gpio(17, 'out', {reconfigureDirection: false});
...

from onoff.

fivdi avatar fivdi commented on June 12, 2024

@elfive was is possible to make progress here? Did the proposed solution work?

from onoff.

elfive avatar elfive commented on June 12, 2024

I wanna init a gpio instance(pin direction set to 'out') without change it's pin status('low' or 'high'),

If I understand the requirement correctly, I would expect something like the following to work:

const Gpio = require('onoff').Gpio;
const led = new Gpio(17, 'out', {reconfigureDirection: false});
...

Sorry, the suggestion won’t work.
when direction set to "out", It will automatically set the pin status to LOW……

from onoff.

fivdi avatar fivdi commented on June 12, 2024

when direction set to "out", It will automatically set the pin status to LOW……

This is not correct. When the reconfigureDirection option is set to false, the state of a pin that is already configured as an output (already exported) will not be modified.

What have you tried and what were the problems? Can you post a complete but short program that can be used to reproduce the problem please?

from onoff.

elfive avatar elfive commented on June 12, 2024

I’m writing a homebridge plugin,you can find my code here: https://github.com/elfive/homebridge-raspberry-simplegpio

from onoff.

fivdi avatar fivdi commented on June 12, 2024

If you can post a complete but short program that can be used to reproduce the issue I can look into the problem. The short program shouldn't use homebridge. What I can't do is learn about homebridge to debug a problem that you are having.

from onoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.