0

I'm going to turn on/off an LED via pin1# (3v3) & GND. My current code is something like this:

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

GPIO.setup(1,GPIO.OUT)

GPIO.output(1,GPIO.HIGH)
time.sleep(5)
GPIO.output(1,GPIO.LOW)

But it won't turn off by the last line. Anyone can find a clue?

1 Answer 1

2

You can only control the voltage of pins connected to GPIO.

Pin 1 is connected to the 3V3 rail and is NOT a GPIO.

GPIO 1 is connected to pin 28 on the Pi models with the 40 pin expansion header.

2
  • Thanks a million for your response. Is it possible to change the current of pins connected to GPIO? Feb 14, 2018 at 18:20
  • Not to any significant extent. The GPIO can be set to low (0V) or high (3V3). Generally they can source or sink about 16 milliamps. They are intended to drive logic circuitry and very low power devices like LEDs.
    – joan
    Feb 14, 2018 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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