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

GPIO starts fluctating #121

Open
thinkrapido opened this issue Jan 2, 2023 · 1 comment
Open

GPIO starts fluctating #121

thinkrapido opened this issue Jan 2, 2023 · 1 comment
Assignees

Comments

@thinkrapido
Copy link

Sorry for asking this question here, but I don't see any reason, why this happens.
Maybe it is an electronic issue.
Please help.

I have this programm here: https://github.com/rusticus-io/sound-player/blob/main/src/main.rs

I monitor my gpio with watch -n 1 raspi-gpio get 4

Before I start the program everything works fine, but after I start my program the gpio pin starts fluctuating and I receive a is_high unnecessarily, so this projects plays sounds on and on and not only after short-circuiting V3.3 with GPIO4.

After reattaching from power supply the PIN behaves as expected again.

@golemparts
Copy link
Owner

If you're not using a pullup or pulldown resistor, your input pin is likely floating and returning seemingly random results. I suggest enabling the Raspberry Pi's built-in pulldown resistor by changing into_input() into into_input_pulldown() and see if that helps resolve the issue.

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

No branches or pull requests

2 participants