@@ -149,18 +149,29 @@ Each of these pins are instances of the ``MicroBitPin`` class, which offers the
149
149
# Only available for touch pins 0, 1, and 2. Returns boolean if the pin
150
150
# is touched
151
151
pin.is_touched()
152
- # Only available for touch pins 0, 1, 2 and on micro:bit V2 also the logo.
153
- # Sets the touch mode. Value can be either RESISTIVE or CAPACITIVE
152
+ # Only available for touch pins 0, 1, and 2. Returns boolean if the pin
153
+ # has been touched since the last time this method was called
154
+ pin.was_touched()
155
+ # Only available for touch pins 0, 1, and 2. Returns the running total of
156
+ # pin touches, and resets this counter to zero
157
+ pin.get_touches()
158
+ # Only available for touch pins 0, 1, and 2. Sets the touch mode.
159
+ # Value can be either RESISTIVE or CAPACITIVE
154
160
pin.set_touch_mode(value)
155
161
156
162
Except in the case of the pins marked **V2 **, which offers the following API:
157
163
158
164
pin_logo::
159
165
160
- # returns boolean for logo touch pin
166
+ # returns a boolean for logo touch pin
161
167
pin_logo.is_touched()
168
+ # returns a boolean if the logo was pressed since the last time
169
+ # this method was called
170
+ pin_logo.was_touched()
171
+ # returns the running total of touches, and resets this counter to zero
172
+ pin_logo.get_touches()
162
173
# Sets the touch mode. Value can be either RESISTIVE or CAPACITIVE
163
- pin .set_touch_mode(value)
174
+ pin_logo .set_touch_mode(value)
164
175
165
176
pin_speaker, as the above ``MicroBitPin `` class, but does not include
166
177
``pin.is_touched() ``.
0 commit comments