Skip to content

Commit d05ff91

Browse files
committed
add example to readme
1 parent 1b17cb9 commit d05ff91

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ Usage Example
9393

9494
.. code-block:: python
9595
96+
import time
97+
import board
98+
import adafruit_adg72x
99+
100+
i2c = board.I2C()
101+
switch = adafruit_adg72x.ADG72x(i2c)
102+
103+
count = 0
104+
105+
while True:
106+
print(f"Selecting channel {count}")
107+
switch.channel = count
108+
count = (count + 1) % 8
109+
time.sleep(1)
110+
96111
Documentation
97112
=============
98113
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/adg72x/en/latest/>`_.

examples/adg72x_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2024 Liz Clark for Adafruit Industries
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

55
import time
66
import board

0 commit comments

Comments
 (0)