Giter Club home page Giter Club logo

Comments (4)

bobrathbone avatar bobrathbone commented on August 11, 2024

Can you please provide more information. What OS are you using (should be bookworm)? What model Pi are you using? Are you using Python3 ? Send me a copy of your test program. I tested with the following code.

#!/usr/bin/env python3
import RPi.GPIO as GPIO
import time

def button_press(gpio):
    print("button ",gpio )

BUTTON_IN = 20
BUTTON_BOUNCE_TIME = 2000
GPIO.add_event_detect(BUTTON_IN, GPIO.BOTH, callback=button_press, bouncetime=BUTTON_BOUNCE_TIME)

while True:
    time.sleep(0.1)
  

The add event worked fine.
By the way do you really want a 2-second bounce time? 50 to 300 ms should be fine.

from gpioconverter.

icyz avatar icyz commented on August 11, 2024

Sure, you're right, sorry:
Python 3.11.2
Raspberry PI 5 bookworm

I've tried your code, and it works... so strange. It's strange that my code isn't working. Let me investigate a bit.

from gpioconverter.

bobrathbone avatar bobrathbone commented on August 11, 2024

Do you have any further comments on this issue otherwise I will close it as NO FAULT FOUND in seven days time.

from gpioconverter.

icyz avatar icyz commented on August 11, 2024

Everything is working correctly. I've done some more testing, but I haven't encountered anything. The issue was due to my own code. Thank you very much.

from gpioconverter.

Related Issues (1)

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.