diff --git a/examples/pca9685_calibration.py b/examples/pca9685_calibration.py index aaf2d5c..3805938 100644 --- a/examples/pca9685_calibration.py +++ b/examples/pca9685_calibration.py @@ -7,18 +7,15 @@ # speed. import time - -from board import SCL, SDA -import busio - -# Import the PCA9685 module. +import board from adafruit_pca9685 import PCA9685 # Create the I2C bus interface. -i2c_bus = busio.I2C(SCL, SDA) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = busio.I2C(board.GP1, board.GP0) # Pi Pico RP2040 # Create a simple PCA9685 class instance. -pca = PCA9685(i2c_bus) +pca = PCA9685(i2c) # Set the PWM frequency to 100hz. pca.frequency = 100 diff --git a/examples/pca9685_servo.py b/examples/pca9685_servo.py index fd36193..f39e377 100644 --- a/examples/pca9685_servo.py +++ b/examples/pca9685_servo.py @@ -2,16 +2,12 @@ # SPDX-License-Identifier: MIT import time - -from board import SCL, SDA -import busio - -# Import the PCA9685 module. Available in the bundle and here: -# https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 +import board from adafruit_motor import servo from adafruit_pca9685 import PCA9685 -i2c = busio.I2C(SCL, SDA) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = busio.I2C(board.GP1, board.GP0) # Pi Pico RP2040 # Create a simple PCA9685 class instance. pca = PCA9685(i2c) diff --git a/examples/pca9685_simpletest.py b/examples/pca9685_simpletest.py index 4d4a06e..7a438a2 100644 --- a/examples/pca9685_simpletest.py +++ b/examples/pca9685_simpletest.py @@ -1,20 +1,19 @@ # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT -# This simple test outputs a 50% duty cycle PWM single on the 0th channel. Connect an LED and -# resistor in series to the pin to visualize duty cycle changes and its impact on brightness. +# Outputs a 50% duty cycle PWM single on the 0th channel. +# Connect an LED and resistor in series to the pin +# to visualize duty cycle changes and its impact on brightness. -from board import SCL, SDA -import busio - -# Import the PCA9685 module. +import board from adafruit_pca9685 import PCA9685 # Create the I2C bus interface. -i2c_bus = busio.I2C(SCL, SDA) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = busio.I2C(board.GP1, board.GP0) # Pi Pico RP2040 # Create a simple PCA9685 class instance. -pca = PCA9685(i2c_bus) +pca = PCA9685(i2c) # Set the PWM frequency to 60hz. pca.frequency = 60