Skip to content

Commit c7a4a8e

Browse files
authored
Merge pull request #4 from dastels/master
Update example code
2 parents 18feec7 + 727b08f commit c7a4a8e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ Usage Example
3333

3434
.. code-block:: python
3535
36-
import board
37-
from digitalio import Pull
38-
from adafruit_debouncer import Debouncer
36+
import board
37+
import digitalio
38+
from adafruit_debouncer import Debouncer
3939
40-
switch = Debouncer(board.D12, Pull.UP)
40+
pin = digitalio.DigitalInOut(board.D12)
41+
pin.direction = digitalio.Direction.INPUT
42+
pin.pull = digitalio.Pull.UP
43+
switch = Debouncer(pin)
4144
42-
while True:
43-
switch.update()
45+
while True:
46+
switch.update()
4447
if switch.fell:
4548
print('Just pressed')
4649
if switch.rose:

0 commit comments

Comments
 (0)