diff --git a/docs/microbit_micropython_api.rst b/docs/microbit_micropython_api.rst index c2fff60f9..228dc1fd7 100644 --- a/docs/microbit_micropython_api.rst +++ b/docs/microbit_micropython_api.rst @@ -158,6 +158,9 @@ Each of these pins are instances of the ``MicroBitPin`` class, which offers the # Only available for touch pins 0, 1, and 2. Sets the touch mode. # Value can be either RESISTIVE or CAPACITIVE pin.set_touch_mode(value) + # Only available for touch pins 0, 1, and 2. Re-calibrates the touch pin + # detection. + pin.touch_calibrate() Except in the case of the pins marked **V2**, which offers the following API: @@ -172,6 +175,8 @@ pin_logo:: pin_logo.get_touches() # Sets the touch mode. Value can be either RESISTIVE or CAPACITIVE pin_logo.set_touch_mode(value) + # Re-calibrates the touch pin detection. + pin.touch_calibrate() pin_speaker, as the above ``MicroBitPin`` class, but does not include ``pin.is_touched()``. diff --git a/docs/pin.rst b/docs/pin.rst index 82b4e88dd..ad4e73b6f 100644 --- a/docs/pin.rst +++ b/docs/pin.rst @@ -197,6 +197,12 @@ its own to that. .. py:class:: MicroBitTouchPin + .. py:method:: touch_calibrate() + + Re-calibrates the touch pin detection. + This is useful when a conductive object is connected to the pin to + be used as a touch sensor. + .. py:method:: is_touched() Return ``True`` if the pin is being touched with a finger, otherwise