# Import the PCA9685 module.
import Adafruit_PCA9685
import time
 # ===========================================================================
 # Simple routine to make K9's tail wag left and right
 # ===========================================================================
pwm = Adafruit_PCA9685.PCA9685()
pwm.set_pwm_freq(60)		# set frequency to 60 Hz

pwm.set_pwm(4, 0, 320)	# centre tail vertically

count= 0
while count < 4:
    pwm.set_pwm(5, 0, 325)	# tail left
    time.sleep(0.25)
    pwm.set_pwm(5, 0, 440)	# tail right
    time.sleep(0.25)
    count +=1
pwm.set_pwm(5, 0, 350)	# tail centre

@@ -1,69 +1,4 @@
-# Import the PCA9685 module.%0Aimport Adafruit_PCA9685%0Aimport time%0A
  # =
@@ -210,69 +210,177 @@
 ===%0A
-pwm = Adafruit_PCA9685.PCA9685()%0Apwm.set_pwm_freq(60)%09%09# set 
+# Import the PCA9685 module.%0Aimport time%0Aimport board%0Aimport busio%0Aimport adafruit_pca9685%0Ai2c = busio.I2C(board.SCL, board.SDA)%0Apca = adafruit_pca9685.PCA9685(i2c)%0Apca.
 freq
@@ -389,41 +389,48 @@
 ncy 
-to 60 Hz%0A%0Apwm.set_pwm(4, 0, 320)%09
+= 60%0A%0Apca.channels%5B4%5D.duty_cycle = 5121 
 # ce
@@ -476,24 +476,76 @@
 unt %3C 4:%0A   
+ pca.channels%5B5%5D.duty_cycle = 5201%09# tail left%0A    #
  pwm.set_pwm
@@ -592,16 +592,69 @@
 .25)%0A   
+ pca.channels%5B5%5D.duty_cycle = 7042%09# tail right%0A    #
  pwm.set
@@ -717,16 +717,18 @@
 unt +=1%0A
+# 
 pwm.set_
@@ -755,9 +755,270 @@
 l centre
-%0A
+4%0Apca.channels%5B5%5D.duty_cycle = 5601%09# tail centre%0A%0A#import Adafruit_PCA9685%0A#import time%0A#pwm = Adafruit_PCA9685.PCA9685()%0A#pwm.set_pwm_freq(60)%09%09# set frequency to 60 Hz%0A# origianlly out of 4095, now 65535%0A# 320 -%3E 5121%0A# 325 -%3E 5201%0A# 350 -%3E 5601%0A# 440 -%3E 7042

Update wag_h.py