Skip to content

Commit

Permalink
docs: Add get_touches() to MicroBitTouchPin.
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Mar 19, 2024
1 parent a7c1b52 commit 5d8cce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/microbit_micropython_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ Each of these pins are instances of the ``MicroBitPin`` class, which offers the
# Only available for touch pins 0, 1, and 2. Returns boolean if the pin
# has been touched since the last time this method was called
pin.was_touched()
# Only available for touch pins 0, 1, and 2. Returns the running total of
# pin touches, and resets this counter to zero
pin.get_touches()
# Only available for touch pins 0, 1, 2 and on micro:bit V2 also the logo.
# Sets the touch mode. Value can be either RESISTIVE or CAPACITIVE
pin.set_touch_mode(value)
Expand All @@ -165,6 +168,8 @@ pin_logo::
# returns a boolean if the logo was pressed since the last time
# this method was called
pin_logo.was_touched()
# returns the running total of touches, and resets this counter to zero
pin.get_touches()
# Sets the touch mode. Value can be either RESISTIVE or CAPACITIVE
pin.set_touch_mode(value)

Expand Down
5 changes: 5 additions & 0 deletions docs/pin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ its own to that.
Returns ``True`` or ``False`` to indicate if the pin was touched
since the device started or since the last time this method was called.

.. py:method:: get_touches()
Returns the number of times the pin was touched
since the device started or since the last time this method was called.

.. py:method:: set_touch_mode(value)
.. note::
Expand Down

0 comments on commit 5d8cce7

Please sign in to comment.