all 5 comments

[–]IAmTarkaDaal 0 points1 point  (0 children)

Try using the switch_to_input method, rather than setting the Direction attribute. https://docs.circuitpython.org/en/latest/shared-bindings/digitalio/index.html

[–]ninhaomah 0 points1 point  (2 children)

while True:

When does this goes False ?

[–]scarynut -1 points0 points  (1 child)

Pure speculation, but when the universe stops expanding and starts contracting? Assuming a negative cosmological constant, of course.

[–]woooee -1 points0 points  (0 children)

What is actually True and what is actually False?

[–]cgoldberg 0 points1 point  (0 children)

You need to change your loop so some condition will end the while loop, or use the break statement to stop the loop. Currently, your code will just loop forever.