Skip to content

Commit

Permalink
docs: Move resistive/capacitive description to set_touch_mode().
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Mar 4, 2024
1 parent 828de9a commit a7c1b52
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions docs/pin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,20 @@ its own to that.
Return ``True`` if the pin is being touched with a finger, otherwise
return ``False``.

.. py:method:: was_touched()
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:: set_touch_mode(value)
.. note::
The default touch mode for the pins on the edge connector is
The default touch mode for the pins on the edge connector is
`resistive`. The default for the logo pin **V2** is `capacitive`.

Set the touch mode for the given pin. Value can be either ``CAPACITIVE``
or ``RESISTIVE``. For example, ``pin0.set_touch_mode(pin0.CAPACITIVE)``.

**Resistive touch**
This test is done by measuring how much resistance there is between the
pin and ground. A low resistance gives a reading of ``True``. To get
Expand All @@ -217,20 +227,6 @@ its own to that.
using a finger as a conductor. `Capacitive touch
<https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing>`_
does not require you to make a ground connection as part of a circuit.

.. py:method:: was_touched()
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:: set_touch_mode(value)
.. note::
The default touch mode for the pins on the edge connector is
`resistive`. The default for the logo pin **V2** is `capacitive`.

Set the touch mode for the given pin. Value can be either ``CAPACITIVE``
or ``RESISTIVE``. For example, ``pin0.set_touch_mode(pin0.CAPACITIVE)``.

The pull mode for a pin is automatically configured when the pin changes to an
input mode. Input modes are when you call ``read_analog`` / ``read_digital`` /
Expand Down

0 comments on commit a7c1b52

Please sign in to comment.