bbcmicrobit / bbcmicrobit/micropython
Method to override the value error if a display pin is used for I/O when the display is on
- Dominant language
- C
- Stars
- 646
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
I realise that this is a bit of an outlier in terms of functionality, but I have some code that requires one more analogue I/O pin that is available when the display is turned on. I just wrote the code to use a pin which doubles up with the display regardless. With earlier versions of interpreter, this code would work just fine. There is some display corruption, but not so much that the output I need to show is unreadable. However, the latest MicroPython hex now gives an error when I try to run my code:
ValueError: Pin X in display mode
I appreciate that most people would want the sanity check here, but it would be really handy if there were some kind of override so that code such as mine can continue to work. I really want to do this! The code I'm using has been running reliably for about 8 months now with no obvious adverse effects on the MicroBit. I can work around this for now by using an older version of the MicroPython hex, so it's not an urgent problem, but there may be other use cases where this is desirable.
I've noticed this primarily because I upgraded from Mu 0.9.13 to the 1.0.0 beta a while back, which comes with a more recent version of the hex file. I'm assuming this commit:
https://github.com/bbcmicrobit/micropython/pull/345/commits/ce36e0dea1c23f0608493978c839707386f34ce6
Is the point where the sanity check was added.
I suppose another way to deal with this would be by allowing the display to be partially enabled, so that pins which are shared with the display can be released while retaining some display function, but I can no idea if the Micro:Bit hardware can support that.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.