Problem drumhat with raspberry pi 1 A+


#1

I have problem with drumhat
It doesn’t work when I run drums.py
Please some help
Thanks


#2

What version of Raspbian?

Try running and posting the results of:

lsb_release -a
uname -a

#3

Thank you for reply Phil
This is result


#4
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
def test(pin):
    print(pin)
GPIO.add_event_detect(25, GPIO.FALLING, callback=test, bouncetime=1)

Try saving the above to a file - test.py - and running it with python test.py. Hopefully I’ve not typo’d it!

I believe normally this means another script is potentially using that pin- do you have anything else running on your Pi? Especially Python scripts which might be running on boot.


#5

Thank you Phil
I tried it but runtime error
I got piano hat and it’s running with simple-piano.py
Drumhat ran test.py
It’s LED light with rolling