Git Product home page Git Product logo

Comments (4)

djkieras avatar djkieras commented on August 23, 2024

https://gpiozero.readthedocs.io/en/stable/api_output.html#outputdevice

from rust_gpiozero.

rahul-thakoor avatar rahul-thakoor commented on August 23, 2024

hey @djkieras
can you try using https://docs.rs/rust_gpiozero/0.2.0/rust_gpiozero/output_devices/struct.OutputDevice.html#method.set_active_high and passing false after you create an OutputDevice?

from rust_gpiozero.

djkieras avatar djkieras commented on August 23, 2024

Already tried that. The thing is, the pin is instantiated with the defaults beforehand, and thus the device already has fired before the call to set_active_high. This happens after the initial boot of the Pi, but if you terminate the process and then restart it, it seems to work fine.

My suspicion is that the Pi OS does not know the default state of the pin and thus the first creation and subsequent operations affect the behavior until a restart. This could be a GPIO state bug that might be remedied in the future.

I made a couple of small changes to /boot/config.txt to set my desired pin to active_low. Limited testing indicates that may indeed work; however, seems like it would be unreliable per the documentation, and definitely overridden by any software. https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md

from rust_gpiozero.

djkieras avatar djkieras commented on August 23, 2024

Been away from this project a while. Gotta get back into the swing of Rust after 6 month Java contract. If I remember correctly, directly emulating Python is not going to work because Rust does not allow optional parameters. Perhaps I will noodle with a few things and learn from that and have a suggestion, or a contribution.

from rust_gpiozero.

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.