From 1e4cf1b898cad09629c4549ea83efe2718c255c8 Mon Sep 17 00:00:00 2001 From: Guy Carver Date: Wed, 12 May 2021 15:51:32 -0400 Subject: [PATCH] Switched from pyb to machine import so it works on multiple boards. --- lib/pca9865.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pca9865.py b/lib/pca9865.py index 8529665..b3e36de 100644 --- a/lib/pca9865.py +++ b/lib/pca9865.py @@ -1,7 +1,7 @@ # MicroPython PCA9865 16 servo controller driver. #NOTE: I tried writing 16 bit values for PWM but it crashed the controller requiring a power cycle to reset. -import pyb +import machine from time import sleep_us class pca9865(object): @@ -28,7 +28,7 @@ class pca9865(object): def __init__(self, aLoc) : '''aLoc I2C pin location is either 1, 'X', 2 or'Y'.''' super(pca9865, self).__init__() - self.i2c = pyb.I2C(aLoc, pyb.I2C.MASTER) + self.i2c = machine.I2C(aLoc, machine.I2C.MASTER) # print(self.i2c) self._buffer = bytearray(4) self._b1 = bytearray(1)