Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added commented out board.STEMMA_I2C with explanation #111

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/seesaw_analogin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_arcade_qt_multi_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_arcade_qt_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_attiny_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_crickit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_digitalio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_eeprom_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_joy_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_minitft_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_neopixel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_pwmout_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions examples/seesaw_rotary_multiples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_rotary_neopixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion examples/seesaw_rotary_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion examples/seesaw_soil_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down