On my Raspberry Pi B+ I have a standard program to blink a LED. I run it using the terminal command python blinky.py
, and when I do, the LED lights up, but does not blink, as it should. I then cancel the running command using ctrl+c, but the LED remains on.
Thoughts? Python code is below.
import RPi.GPIO as GPIO
import time
# blinking function
def blink(pin):
GPIO.output(pin,GPIO.HIGH)
time.sleep(100)
GPIO.output(pin,GPIO.LOW)
time.sleep(100)
return
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(11, GPIO.OUT)
# blink GPIO17 50 times
for i in range(0,550):
blink(11)
GPIO.cleanup()
Edit: The circuit I used connected pin 9 as ground to a resistor to reduce the voltage to a palatable amount to the LED, then through the LED to GPIO pin 11.