I am quite new to using the Raspberry Pi2. Currently I am trying to run the Screaming Jelly Baby program in Python by using the GPIO pins https://www.raspberrypi.org/learning/screaming-jellybaby/worksheet/
The problem I am getting is that when I run the program the .wav file is just continuously playing. This should only play when I touch the two paper clips together.
My code is as follows:
import time import RPi.GPIO as GPIO import os GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(26,GPIO.IN) while True: if GPIO.input(26) == False: os.system('mpg321 scream.mp3') time.sleep(1)
I know I am using pin 26. This is because when I try running on pin 3 I get the following message:
Warning (from warnings module): File "/home/pi/burp.py", line 7 GPIO.setup(3,GPIO.IN) RuntimeWarning: A physical pull up resistor is fitted on this channel!
Help with this would really be appreciated.