I would love help understanding why in the world this works from a physics/electronics perspective as I’m totally stumped. Can someone please help explain??
in MakeCode block editor, I put in a forever loop
digitalWrite [Pin 15] to (1)
if <(digitalRead [Pin 15]) = (1)>:
Play tone (middle C) for (1/2) beat
Now, when I touch Pin 15 with my finger it makes the sound.
Sometimes I need to be also touching GND (particularly when the microbit power source is only a battery pack - but, not always). And sometimes I do not need to also be touching GND pin (particularly when the microbit is connected to a computer via usb).
I have created an 8 key musical conductors keyboard this way with pins 0,1,2,8,12,14,15,16
Please help explain why this actually behaves like a “on Pin touched” and (if possible) why sometimes I need to be also touching GND and others not.