Skip to content

Commit ccd485d

Browse files
committed
Fix issue adafruit#6 and add tca8418_simpletest.py
1 parent c368f8d commit ccd485d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/tca8418_simpletest.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2022 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
import time
6+
import board
7+
from adafruit_tca8418 import TCA8418
8+
9+
i2c = board.I2C() # uses board.SCL and board.SDA
10+
tca = TCA8418(i2c)
11+
12+
# setup R0 as an output GPIO
13+
OUTPIN = TCA8418.R0
14+
tca.gpio_mode[OUTPIN] = True
15+
tca.gpio_direction[OUTPIN] = True
16+
17+
# blink it!
18+
while True:
19+
tca.output_value[OUTPIN] = True
20+
time.sleep(0.1)
21+
tca.output_value[OUTPIN] = False
22+
time.sleep(0.1)

0 commit comments

Comments
 (0)