I need to add a status led to my pi zero w and after taking a look at the pin out I decided to put an led between pin 5 and 6. Please see attached picture. I soldered a blue 0805 SMD led directly on the holes and it is not coming off easily...
Now I have a problem, I cannot control GPIO3 reliably. This GPIO seems to act randomly. Sometimes it is high and led is on as soon as I plug in power, and I could control it using sample python code for GPIO led. Then after a while it stops working. This pin will stay low no matter what I do...
When I got it working I can control it normally. Either with python script or simply by running "raspi-gpio set 3 op dh". Then after running the blink script for like 30 minutes or so it just stops. I think something is constantly pulling the GPIO down to low and it is stuck in low.
After reading around I saw this pin is also used for i2c stuff and has 18k pull-up resistor to 3.3v. Not sure what is the implication of that for using it as a GPIO output. Does that mean I cannot control a LED with it? Then Why does it work sometimes but not other times?
Btw I2C is not enabled on my board.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(3, GPIO.OUT)
pwm = GPIO.PWM(3, 100)
pwm.start(100)
print("started.")
while 1:
pwm.ChangeDutyCycle(10)
time.sleep(0.01)
pwm.ChangeDutyCycle(0)
time.sleep(0.05)
GPIO.cleanup()