bbcmicrobit / micropython

Port of MicroPython for the BBC micro:bit
https://microbit-micropython.readthedocs.io
Other
603 stars 284 forks source link

Allow to change pin in touch mode to other mode without error. #533

Closed dpgeorge closed 6 years ago

dpgeorge commented 6 years ago

Since touch mode is pretty much just digital input, it makes sense to be able to change from touch mode to other standard GPIO modes (read digital, write digital, read analog) without an error (you can already change from read digital to write digital without error).

Without a patch like this there's no way to get a pin out of touch mode once pin.is_touched() is called.

carlosperate commented 6 years ago

Haven't had a chance to test this yet, but the change looks good to me.

dpgeorge commented 6 years ago

This was merged in eeb9a2d2e4ec7d49354913fcafc990822430c662