just not shure if this is normal behaviour.. that's why i ask here before running an issue
I just loaded a fresh copy of v1.18 on a d1mini.
My goal is to build a simple remote control for my robots and.. it didn't work as expected.
My plan is to use pin irqs to send the pins number via socket connection but my pins were deaf.
So I wrote a little test.. which didn't work, too:
Code: Select all
from machine import Pin
pins = [Pin(x,Pin.IN|Pin.PULL_UP) for x in [14,12,13,15,4,5]]
for pin in pins:
pin.irq(lambda p: print (p))
After re-writing my test like this:
Code: Select all
from machine import Pin
pins = [Pin(x,Pin.IN|Pin.PULL_UP) for x in [14,12,13,15,4,5]]
for pin in pins:
# I just added this line
pin.on()
pin.irq(lambda p: print (p))
It worked... But why?
Maybe, pin creation misses some pin initialization? or is this normal behaviour?
Edit: Just in case... here are my files https://gitlab.com/rapp.jens/mp-robot-remote