I have just started with the GPIO on my raspberry pi but can't get any of the code to work.
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) print "LED on" GPIO.output(18,GPIO.HIGH) time.sleep(1) print "LED off" GPIO.output(18,GPIO.LOW)
I have tried using both pin 12 and 18. I have the led connected to ground (pin 6) through a resistor and to pin 12. It looks like this