From 7d6fa55c02c19280a7ab1a92b496d6e96a7fa3d9 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 18 Nov 2022 13:05:29 -0500 Subject: [PATCH] Added commented out board.STEMMA_I2C with explanation --- examples/seesaw_analogin_test.py | 4 +++- examples/seesaw_arcade_qt_multi_board.py | 3 ++- examples/seesaw_arcade_qt_simpletest.py | 3 ++- examples/seesaw_attiny_simpletest.py | 4 +++- examples/seesaw_crickit_test.py | 3 ++- examples/seesaw_digitalio_test.py | 4 +++- examples/seesaw_eeprom_test.py | 3 ++- examples/seesaw_joy_featherwing.py | 3 ++- examples/seesaw_minitft_featherwing.py | 3 ++- examples/seesaw_neopixel_test.py | 4 +++- examples/seesaw_pwmout_test.py | 4 +++- examples/seesaw_rotary_multiples.py | 7 +++++-- examples/seesaw_rotary_neopixel.py | 4 +++- examples/seesaw_rotary_simpletest.py | 4 +++- examples/seesaw_simpletest.py | 3 ++- examples/seesaw_soil_simpletest.py | 3 ++- 16 files changed, 42 insertions(+), 17 deletions(-) diff --git a/examples/seesaw_analogin_test.py b/examples/seesaw_analogin_test.py index da2741d..97af324 100644 --- a/examples/seesaw_analogin_test.py +++ b/examples/seesaw_analogin_test.py @@ -10,7 +10,9 @@ from adafruit_seesaw.seesaw import Seesaw from adafruit_seesaw.analoginput import AnalogInput -ss = Seesaw(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +ss = Seesaw(i2c) analogin_pin = 2 analog_in = AnalogInput(ss, analogin_pin) diff --git a/examples/seesaw_arcade_qt_multi_board.py b/examples/seesaw_arcade_qt_multi_board.py index b58e2c8..cc602a5 100644 --- a/examples/seesaw_arcade_qt_multi_board.py +++ b/examples/seesaw_arcade_qt_multi_board.py @@ -7,7 +7,8 @@ from adafruit_seesaw.digitalio import DigitalIO # For most boards. -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # For the QT Py RP2040, QT Py ESP32-S2, other boards that have SCL1/SDA1 as the STEMMA QT port. # import busio diff --git a/examples/seesaw_arcade_qt_simpletest.py b/examples/seesaw_arcade_qt_simpletest.py index f11fd56..3b55180 100644 --- a/examples/seesaw_arcade_qt_simpletest.py +++ b/examples/seesaw_arcade_qt_simpletest.py @@ -12,7 +12,8 @@ delay = 0.01 # For most boards. -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # For the QT Py RP2040, QT Py ESP32-S2, other boards that have SCL1/SDA1 as the STEMMA QT port. # import busio diff --git a/examples/seesaw_attiny_simpletest.py b/examples/seesaw_attiny_simpletest.py index 5b9991e..f32e189 100644 --- a/examples/seesaw_attiny_simpletest.py +++ b/examples/seesaw_attiny_simpletest.py @@ -7,7 +7,9 @@ import board from adafruit_seesaw.seesaw import Seesaw -ss = Seesaw(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +ss = Seesaw(i2c) ss.pin_mode(5, ss.OUTPUT) diff --git a/examples/seesaw_crickit_test.py b/examples/seesaw_crickit_test.py index d77ff25..971b0b8 100644 --- a/examples/seesaw_crickit_test.py +++ b/examples/seesaw_crickit_test.py @@ -9,7 +9,8 @@ # from analogio import AnalogOut # import board -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = Seesaw(i2c_bus) pwm1 = PWMOut(ss, 17) pwm2 = PWMOut(ss, 16) diff --git a/examples/seesaw_digitalio_test.py b/examples/seesaw_digitalio_test.py index 2e197ec..6b64fac 100644 --- a/examples/seesaw_digitalio_test.py +++ b/examples/seesaw_digitalio_test.py @@ -15,7 +15,9 @@ from adafruit_seesaw.seesaw import Seesaw from adafruit_seesaw.digitalio import DigitalIO -ss = Seesaw(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +ss = Seesaw(i2c) button_pin = 2 led_pin = 5 diff --git a/examples/seesaw_eeprom_test.py b/examples/seesaw_eeprom_test.py index 130a4bb..e9835cb 100644 --- a/examples/seesaw_eeprom_test.py +++ b/examples/seesaw_eeprom_test.py @@ -9,7 +9,8 @@ import board from adafruit_seesaw import seesaw -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = seesaw.Seesaw(i2c_bus) value = ss.eeprom_read8(0x02) # Read from address 2 diff --git a/examples/seesaw_joy_featherwing.py b/examples/seesaw_joy_featherwing.py index 2512bf0..952051d 100755 --- a/examples/seesaw_joy_featherwing.py +++ b/examples/seesaw_joy_featherwing.py @@ -21,7 +21,8 @@ | (1 << BUTTON_SEL) ) -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = Seesaw(i2c_bus) diff --git a/examples/seesaw_minitft_featherwing.py b/examples/seesaw_minitft_featherwing.py index e6f31a3..1103e98 100644 --- a/examples/seesaw_minitft_featherwing.py +++ b/examples/seesaw_minitft_featherwing.py @@ -26,7 +26,8 @@ | (1 << BUTTON_B) ) -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = Seesaw(i2c_bus, 0x5E) diff --git a/examples/seesaw_neopixel_test.py b/examples/seesaw_neopixel_test.py index 43e654b..aa68b5f 100644 --- a/examples/seesaw_neopixel_test.py +++ b/examples/seesaw_neopixel_test.py @@ -15,7 +15,9 @@ from rainbowio import colorwheel from adafruit_seesaw import seesaw, neopixel -ss = seesaw.Seesaw(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +ss = seesaw.Seesaw(i2c) NEOPIXEL_PIN = 19 # Can be any pin NEOPIXEL_NUM = 12 # No more than 60 pixels! diff --git a/examples/seesaw_pwmout_test.py b/examples/seesaw_pwmout_test.py index 06bcc0e..4efe1b5 100644 --- a/examples/seesaw_pwmout_test.py +++ b/examples/seesaw_pwmout_test.py @@ -15,7 +15,9 @@ import board from adafruit_seesaw import seesaw, pwmout -ss = seesaw.Seesaw(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +ss = seesaw.Seesaw(i2c) PWM_PIN = 12 # If desired, change to any valid PWM output! led = pwmout.PWMOut(ss, PWM_PIN) diff --git a/examples/seesaw_rotary_multiples.py b/examples/seesaw_rotary_multiples.py index 097c86a..e349746 100644 --- a/examples/seesaw_rotary_multiples.py +++ b/examples/seesaw_rotary_multiples.py @@ -7,8 +7,11 @@ import board from adafruit_seesaw import seesaw, rotaryio, digitalio, neopixel -qt_enc1 = seesaw.Seesaw(board.I2C(), addr=0x36) -qt_enc2 = seesaw.Seesaw(board.I2C(), addr=0x37) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller + +qt_enc1 = seesaw.Seesaw(i2c, addr=0x36) +qt_enc2 = seesaw.Seesaw(i2c, addr=0x37) qt_enc1.pin_mode(24, qt_enc1.INPUT_PULLUP) button1 = digitalio.DigitalIO(qt_enc1, 24) diff --git a/examples/seesaw_rotary_neopixel.py b/examples/seesaw_rotary_neopixel.py index 62e47bd..3c6f5de 100644 --- a/examples/seesaw_rotary_neopixel.py +++ b/examples/seesaw_rotary_neopixel.py @@ -12,7 +12,9 @@ # i2c = busio.I2C(board.SCL1, board.SDA1) # seesaw = seesaw.Seesaw(i2c, 0x36) -seesaw = seesaw.Seesaw(board.I2C(), 0x36) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +seesaw = seesaw.Seesaw(i2c, 0x36) encoder = rotaryio.IncrementalEncoder(seesaw) seesaw.pin_mode(24, seesaw.INPUT_PULLUP) diff --git a/examples/seesaw_rotary_simpletest.py b/examples/seesaw_rotary_simpletest.py index 7f3bbbc..8470318 100644 --- a/examples/seesaw_rotary_simpletest.py +++ b/examples/seesaw_rotary_simpletest.py @@ -11,7 +11,9 @@ # i2c = busio.I2C(board.SCL1, board.SDA1) # seesaw = seesaw.Seesaw(i2c, 0x36) -seesaw = seesaw.Seesaw(board.I2C(), addr=0x36) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +seesaw = seesaw.Seesaw(i2c, addr=0x36) seesaw_product = (seesaw.get_version() >> 16) & 0xFFFF print("Found product {}".format(seesaw_product)) diff --git a/examples/seesaw_simpletest.py b/examples/seesaw_simpletest.py index 7b7d35c..4f85270 100644 --- a/examples/seesaw_simpletest.py +++ b/examples/seesaw_simpletest.py @@ -10,7 +10,8 @@ import board from adafruit_seesaw.seesaw import Seesaw -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = Seesaw(i2c_bus) diff --git a/examples/seesaw_soil_simpletest.py b/examples/seesaw_soil_simpletest.py index 9fccd66..735d0f5 100644 --- a/examples/seesaw_soil_simpletest.py +++ b/examples/seesaw_soil_simpletest.py @@ -7,7 +7,8 @@ from adafruit_seesaw.seesaw import Seesaw -i2c_bus = board.I2C() +i2c_bus = board.I2C() # uses board.SCL and board.SDA +# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller ss = Seesaw(i2c_bus, addr=0x36)