when i run the following code the light flashes when X5 is connected to 3V3 . the light doesn't flash when disconnected or X5 is connected to GND as expected
Code: Select all
from pyb import Pin, LED, delay
wire=Pin('X5',Pin.IN, Pin.PULL_DOWN)
light=LED(3)
while True:
if wire.value():
light.toggle()
else:
light.off()
delay(500)
when i change the pin to Y10 the following happens Y10 connected to 3V3 the light is flashing as it is incorrectly when disconnected. it's only when i connect Y10 to GND is it that the light goes out.
it's as though the pull down resistors don't work.
thanks