Tuesday, 13 August 2013

Running Python script causes Raspberry Pi to lose power

Running Python script causes Raspberry Pi to lose power

I've created the following script:
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(15,GPIO.OUT)
GPIO.output(15,False)
GPIO.setup(6,GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
while GPIO.input(22) == GPIO.LOW:
time.sleep(0.1)
if GPIO.input(6)==GPIO.HIGH:
print("YAY")
The purpose of this code is to detect the press of a button connected to
my Raspberry Pi, but even without any circuitry set up, just starting this
script causes the pi to lose power. Does anyone have any ideas why this
may be and how to fix it?

No comments:

Post a Comment