Git Product home page Git Product logo

Comments (2)

SuhaylZhao avatar SuhaylZhao commented on July 24, 2024

Hi,

Yes, you are right. Adding a 0.1uF capacitance can really make the circuit more robust.

However, the circuit and code has no problem here, and after our tests, even the captureTime is set to 10 seconds, the project still work properly (set captureTime = 10000).

Because releasing the button also requires debouncing. You need waits the same amount of time(captureTime) from releasing to pressing again.

The code running result prompts whether the key is pressed or released, and only when released state is prompted, the key can be pressed again.

In addition, you can try shorting R2, and the test results will be better.

R2 is used to avoid that GPIO output too large current and the IO port is burned when the button is pressed. In this circuit, GPIO18 is input mode, so there is no need for using R2.

Thank you.

from freenove_ultimate_starter_kit_for_raspberry_pi.

mikebern avatar mikebern commented on July 24, 2024

I think you are right. I was actually aware that LOW -> HIGH transition is also debounced, and I have to wait until it comes back to HIGH before pressing the button again. But I forgot to mention about the elephant in the room - I am not running the power source from 9v battery, but from AC/DC wall adaptor, which outputs 9v. I guess it's much noisier than the battery and that makes the critical difference.

So, it looks like I solved the issue that I've created for myself :) Thank you for your prompt follow up and clear explanations! I am closing this issue as it's not a real problem with the circuit.

from freenove_ultimate_starter_kit_for_raspberry_pi.

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.