File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,27 @@ To install in a virtual environment in your current project:
60
60
Usage Example
61
61
=============
62
62
63
- .. todo :: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
63
+ .. code-block :: python
64
+
65
+ import board
66
+ import digitalio
67
+ import adafruit_aw9523
68
+
69
+ i2c = board.I2C()
70
+ aw = adafruit_aw9523.AW9523(i2c)
71
+
72
+ led_pin = aw.get_pin(0 ) # LED on AW9523 io 0
73
+ button_pin = aw.get_pin(1 ) # Button on AW io 1
74
+
75
+ # LED is an output, initialize to high
76
+ led_pin.switch_to_output(value = True )
77
+ # Button is an input, note internal pull-ups are not supported!
78
+ button_pin.direction = digitalio.Direction.INPUT
79
+
80
+ while True :
81
+ # LED mirrors button pin
82
+ led_pin.value = button_pin.value
83
+
64
84
65
85
Contributing
66
86
============
You can’t perform that action at this time.
0 commit comments