docs: Add was_touched & touch_calibrate for pins 0, 1, 2 & pin_logo.#802
docs: Add was_touched & touch_calibrate for pins 0, 1, 2 & pin_logo.#802microbit-carlos wants to merge 3 commits intobbcmicrobit:v2-docsfrom
was_touched & touch_calibrate for pins 0, 1, 2 & pin_logo.#802Conversation
was_touched method for pins 0, 1, 2 & §pin_logo.was_touched method for pins 0, 1, 2 & pin_logo.
669a6d8 to
5d8cce7
Compare
docs/microbit_micropython_api.rst
Outdated
| # this method was called | ||
| pin_logo.was_touched() | ||
| # returns the running total of touches, and resets this counter to zero | ||
| pin.get_touches() |
There was a problem hiding this comment.
Should be pin_logo.get_touches(). Probably also the example below should be changed to pin_logo.set_touch_mode(value).
There was a problem hiding this comment.
These methods are also available for pins 0, 1 and 2, so we are using pin. here as it's been done for pin.is_touched().
There was a problem hiding this comment.
But, this section/paragraph of the docs is all about pin_logo (see line 158/164 above). And the code snippets just above are for pin_logo.is_touched() and pin_logo.was_touched().
So, it should be pin_logo.get_touches() and pin_logo.set_touch_mode() for consistency within this paragraph.
There was a problem hiding this comment.
Oh yes, you are right, I didn't notice in my last message that this was replicated in a pin_logo-only section.
Updated in https://github.com/bbcmicrobit/micropython/compare/4043fc290df1ef1cf281c8211995eca66e27a63f..1fbb7581cf90b6976b183cca855c2cc71989744f.
Yes, that's a good clean up. |
4043fc2 to
1fbb758
Compare
1fbb758 to
30eb501
Compare
was_touched method for pins 0, 1, 2 & pin_logo.was_touched & touch_calibrate for pins 0, 1, 2 & pin_logo.
|
As well keep this PR unmerged until the next MicroPython v2 beta is released, and this PR already touches the pin page, I've also added here the |
62ea073 to
905577a
Compare
9dd1e0c to
b2a0dc9
Compare


Preview:
https://microbit-micropython--802.org.readthedocs.build/en/802/pin.html#microbit.MicroBitTouchPin