0

Hi I am testing my new raspi pins . with the following code am able to toggle all the ports except LED3 ..pin 16 .

Is their a method to identify if the pin itself i broker or not

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
LED1 = 20
LED2 = 21
LED3 = 16
LED4 = 12



while True:

    GPIO.setup(LED1,GPIO.OUT)
    GPIO.output(LED1,True)

    GPIO.setup(LED2,GPIO.OUT)
    GPIO.output(LED2,True)

    GPIO.setup(LED3,GPIO.OUT)
    GPIO.output(LED3,True)

    GPIO.setup(LED4,GPIO.OUT)
    GPIO.output(LED4,True)

    time.sleep(1)

    GPIO.setup(LED1,GPIO.OUT)
    GPIO.output(LED1,False)

    GPIO.setup(LED2,GPIO.OUT)
    GPIO.output(LED2,False)

    GPIO.setup(LED3,GPIO.OUT)
    GPIO.output(LED3,False)

    GPIO.setup(LED4,GPIO.OUT)
    GPIO.output(LED4,False)

    time.sleep(1)
1
  • Which model Pi? If you are not sure tell us the result of this command grep Rev /proc/cpuinfo
    – joan
    Commented May 27, 2015 at 11:22

1 Answer 1

1

Software

You could use the wiringPi library(you may have to install it) as described in this question. It tests input, output, pull-up and pull-down. It will return Failed user gpios: Noneif all your pins are OK.

Hardware

Also, if it returns all clear, make sure that you are observing polarity for LED3. In other words, if you have it in the wrong way it will not work(longer lead is positive).

Your Answer

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

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