Closed microbit-carlos closed 2 years ago
I agree, removing this const from the docs would be a good idea (so it's not used in new code).
But I also think there should be an addition to the docs explaining to some extent the situation with this constant and the 250kb data rate. Eg "A datarate of 250kbit/sec is possible with micro:bit v1, and may be possible with micro:bit v2. To access this hidden feature pass "2" to the data_rate
config argument. This was previously accessible via RATE_250KBIT
but has been removed because it's not guaranteed to work on all v2 devices."
Sounds good 👍 I'll add it to the PR.
As this PR will go into the main branch, which is for the V1 docs I think it might be better to separate this message for each target.
This PR contains the following note in the constants section:
.. note::
A lower data rate of 250 kbit/sec is possible with micro:bit V1 via
the ``RATE_250KBIT`` constant (or using its value ``2`` directly). However
as this rate is not guaranteed to work on V2 it has been deprecated for
compatibility reasons.
And this note below the data_rate
argument in the V2 docs:
.. note::
A lower data rate of of 250kbit/sec is supported in micro:bit V1, and
may be possible with micro:bit V2, but it is not guaranteed to work on
all devices. To access this hidden feature for compatibility with V1
pass ``2`` to the ``data_rate`` argument.
@dpgeorge if the wording looks good we can merge this and create the v2-docs PR after rebasing that branch.
This looks fine to me.
Thanks Damien, as discussed in the call, I've changed it back as a constant with a deprecation notice here and will create a different update specifically for the V2 docs.
I've changed it back as a constant with a deprecation notice
Very good!
The constant is still present in the micro:bit V1 MicroPython port, but it is not in the V2 MicroPython port. The value from the constant (
2
) can be used as an argument in the V2 MicroPythonradio.config(data_rate=2)
, but because it is not officially supported in the V2 nRF52833 microcontroller we cannot guarantee it will always work.To keep the documentation simple it might be better to remove the mention of
radio.RATE_250KBIT
, rather than adding more content to a fairly long function description.Discussion in https://github.com/microbit-foundation/micropython-microbit-v2/issues/87.