Skip to content

Commit

Permalink
Merge pull request #55 from DJDevon3/WorkingBranch
Browse files Browse the repository at this point in the history
Update import and initializations to current standards
  • Loading branch information
BlitzCityDIY authored Mar 14, 2024
2 parents f2dd719 + fcf077a commit 874545d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
11 changes: 4 additions & 7 deletions examples/pca9685_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions examples/pca9685_servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 7 additions & 8 deletions examples/pca9685_simpletest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 874545d

Please sign in to comment.