Screaming Jelly Baby program problems - Raspberry Pi Forums
i quite new using raspberry pi2. trying run screaming jelly baby program in python using gpio pins https://www.raspberrypi.org/learning/sc ... worksheet/
problem getting when run program .mp3 file continuously playing. should play when touch 2 paper clips together.
code follows:
import time
import rpi.gpio 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)
know using pin 26. because when try running on pin 3 following message:
warning (from warnings module): file "/home/pi/burp.py", line 7 gpio.setup(3,gpio.in) runtimewarning: physical pull resistor fitted on channel!
appreciated.
problem getting when run program .mp3 file continuously playing. should play when touch 2 paper clips together.
code follows:
import time
import rpi.gpio 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)
know using pin 26. because when try running on pin 3 following message:
warning (from warnings module): file "/home/pi/burp.py", line 7 gpio.setup(3,gpio.in) runtimewarning: physical pull resistor fitted on channel!
appreciated.
raspberrypi
Comments
Post a Comment