0

Friends,

I try to switch 4 GPIO pins (GPIO.BCM) from '0' to '1', and only the first 2 out of 4 (GPIO18 and GPIO23)do switch, from 0 to 1. I have used different GPIO pins for GPIO24 and GPIO25, without luck. Same result.

I use Python 3.5.3 and GPIO 0.6.5, under Thonny on my Pi 3B V1.2.

Anyone any idea what can be wrong ?

My code (I really simplified to do fault finding):

import time as time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(23, GPIO.OUT)
GPIO.setup(24, GPIO.OUT)
GPIO.setup(25, GPIO.OUT)

GPIO.output(18,1)
GPIO.output(23,1)
GPIO.output(24,1)
GPIO.output(25,1)

print("Pin %s status is: " % (str(18)) + str(GPIO.input(18))) #shows '1'
print("Pin %s status is: " % (str(23)) + str(GPIO.input(23))) #shows '1'
print("Pin %s status is: " % (str(24)) + str(GPIO.input(24))) #shows '0'
print("Pin %s status is: " % (str(25)) + str(GPIO.input(25))) #shows '0'
print("Init sequence Complete")
  • What is connected to those pins? Post a picture of your wiring. – CoderMike Jan 3 at 11:56
1

There appear to be two possibilities.

  1. something is connected to GPIO 24 and GPIO 25 which is pulling those GPIO low.
  2. The Pi is broken.

I suggest you remove everything from the expansion header and run one or both of wiringPi's pintest or (my) pigpio's gpiotest.

  • I have connected the 4 ports to a ULN2003A Stepper Motor Driver. When I disconnect the IC, the pins go up/down. So, Pi seems fine. Looks like GPIO (3.3V) may not work with ULN2003A. Using different pins at the IC, same problem, so IC seems ok as well. Thanks for the hint of disconnecting. – Eric Jan 3 at 12:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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