@@ -50,40 +50,43 @@ def __init__(
50
50
uses clock stretching. Optional IRQ pin (not used),
51
51
resetp pin and debugging output.
52
52
53
- :param busio.I2C i2c: The I2C bus the PN532 is connected to.
53
+ :param ~ busio.I2C i2c: The I2C bus the PN532 is connected to.
54
54
:param int address: The I2C device address. Defaults to :const:`0x24`
55
- :param DigitalInOut reset: board pin the PN532 reset is connected to
56
- :param DigitalInOut req: board pin the PN532 P32 is connected to
57
- :param bool debug: if true print additional debug statements
55
+ :param digitalio. DigitalInOut reset: board pin the PN532 reset is connected to
56
+ :param digitalio. DigitalInOut req: board pin the PN532 P32 is connected to
57
+ :param bool debug: if True print additional debug statements. Defaults to False
58
58
59
59
**Quickstart: Importing and using the device**
60
- Here is an example of using the :class:`PN532_I2C` class.
61
- First you will need to import the libraries to use the sensor
62
60
63
- .. code-block:: python
61
+ Here is an example of using the :class:`PN532_I2C` class.
62
+ First you will need to import the libraries to use the sensor
64
63
65
- import board
66
- import busio
67
- from digitalio import DigitalInOut
68
- from adafruit_pn532.i2c import PN532_I2C
64
+ .. code-block:: python
69
65
70
- Once this is done you can define your `board.I2C` object and define your object
71
- .. code-block:: python
66
+ import board
67
+ import busio
68
+ from digitalio import DigitalInOut
69
+ from adafruit_pn532.i2c import PN532_I2C
72
70
73
- i2c = busio.I2C(board.SCL, board.SDA)
74
- reset_pin = DigitalInOut(board.D6)
75
- # On Raspberry Pi, you must also connect a pin to P32 "H_Request" for hardware
76
- # wakeup! this means we don't need to do the I2C clock-stretch thing
77
- req_pin = DigitalInOut(board.D12)
78
- pn532 = PN532_I2C(i2c, debug=False, reset=reset_pin, req=req_pin)
79
- # Configure PN532 to communicate with MiFare cards
80
- pn532.SAM_configuration()
71
+ Once this is done you can define your `board.I2C` object and define your object
81
72
82
- Now you have access to the attributes and functions of the PN532 RFID/NFC shield or breakout
73
+ .. code-block:: python
83
74
84
- .. code-block:: python
75
+ i2c = busio.I2C(board.SCL, board.SDA)
76
+ reset_pin = DigitalInOut(board.D6)
77
+ # On Raspberry Pi, you must also connect a pin to P32 "H_Request" for hardware
78
+ # wakeup! this means we don't need to do the I2C clock-stretch thing
79
+ req_pin = DigitalInOut(board.D12)
80
+ pn532 = PN532_I2C(i2c, debug=False, reset=reset_pin, req=req_pin)
81
+ # Configure PN532 to communicate with MiFare cards
82
+ pn532.SAM_configuration()
85
83
86
- uid = pn532.read_passive_target(timeout=0.5)
84
+ Now you have access to the attributes and functions of the PN532 RFID/NFC
85
+ shield or breakout
86
+
87
+ .. code-block:: python
88
+
89
+ uid = pn532.read_passive_target(timeout=0.5)
87
90
88
91
"""
89
92
self .debug = debug
0 commit comments