I am not sure what I am doing wrong here.

I found this guide on but it's not working for me. The program does not output any errors but the LED doesn't light up.

I have and LED with + on GPIO 12 and - on GPIO 6 with a 100 Ohm resistor. This is shown in the images below:


enter image description here

Here is the code I am using

import RPi.GPIO as GPIO
import time




GPIO.output(12, GPIO.LOW)
  • I was able to make it work by changing 12 to 18... however when I count the pins it is actually 12? Why is this? – Bruce Levy Dec 3 '18 at 6:45

Thats because by using 'GPIO.setmode(GPIO.BCM)' you are specifying the BCM numbering convention. GPIO 18 is actual pin number 12.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.