From ccd485d5d941178313c23ba5b40b8e436edf0ca7 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Tue, 4 Oct 2022 11:41:37 -0500 Subject: [PATCH 1/2] Fix issue #6 and add tca8418_simpletest.py --- examples/tca8418_simpletest.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/tca8418_simpletest.py diff --git a/examples/tca8418_simpletest.py b/examples/tca8418_simpletest.py new file mode 100644 index 0000000..5ed9c09 --- /dev/null +++ b/examples/tca8418_simpletest.py @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022 ladyada for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +import time +import board +from adafruit_tca8418 import TCA8418 + +i2c = board.I2C() # uses board.SCL and board.SDA +tca = TCA8418(i2c) + +# setup R0 as an output GPIO +OUTPIN = TCA8418.R0 +tca.gpio_mode[OUTPIN] = True +tca.gpio_direction[OUTPIN] = True + +# blink it! +while True: + tca.output_value[OUTPIN] = True + time.sleep(0.1) + tca.output_value[OUTPIN] = False + time.sleep(0.1) From 824ccaeac1b15c91ade603e77e64a952afaca528 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Tue, 4 Oct 2022 15:26:46 -0500 Subject: [PATCH 2/2] Git remove the tca8418_gpioblink.py as it's no longer needed --- examples/tca8418_gpioblink.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 examples/tca8418_gpioblink.py diff --git a/examples/tca8418_gpioblink.py b/examples/tca8418_gpioblink.py deleted file mode 100644 index 5ed9c09..0000000 --- a/examples/tca8418_gpioblink.py +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022 ladyada for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -import time -import board -from adafruit_tca8418 import TCA8418 - -i2c = board.I2C() # uses board.SCL and board.SDA -tca = TCA8418(i2c) - -# setup R0 as an output GPIO -OUTPIN = TCA8418.R0 -tca.gpio_mode[OUTPIN] = True -tca.gpio_direction[OUTPIN] = True - -# blink it! -while True: - tca.output_value[OUTPIN] = True - time.sleep(0.1) - tca.output_value[OUTPIN] = False - time.sleep(0.1)