Comments (4)
https://gpiozero.readthedocs.io/en/stable/api_output.html#outputdevice
from rust_gpiozero.
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.
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.
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)
- Implement SPIDevice
- Implement AnalogInputDevice
- Add unit tests
- Should we use the builder pattern to allow easier customisations?
- Change license to MIT/Apache-2.0 HOT 1
- Questions regarding this project! HOT 2
- Panic on simple blink example HOT 8
- Support for Raspberry Pi 4
- Concurrency Bug causes DoS HOT 2
- Unmable to make LED blink. HOT 2
- Unable to make rust servo code work HOT 2
- Hi, is this project dead? HOT 7
- Some questions HOT 8
- Suggestion: Support for Arduino
- Strange behavior with Button HOT 2
- Not a press/release state change HOT 1
- Output devices clear effects
- Improve input device support
- Improve output device support
- Servo jitter on hardware PWM pin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust_gpiozero.