-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add was_touched
& touch_calibrate
for pins 0, 1, 2 & pin_logo
.
#802
base: v2-docs
Are you sure you want to change the base?
docs: Add was_touched
& touch_calibrate
for pins 0, 1, 2 & pin_logo
.
#802
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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