kopia lustrzana https://github.com/GuyCarver/MicroPython
Switched from pyb to machine import so it works on multiple boards.
rodzic
6c01843e20
commit
1e4cf1b898
|
@ -1,7 +1,7 @@
|
||||||
# MicroPython PCA9865 16 servo controller driver.
|
# 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.
|
#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
|
from time import sleep_us
|
||||||
|
|
||||||
class pca9865(object):
|
class pca9865(object):
|
||||||
|
@ -28,7 +28,7 @@ class pca9865(object):
|
||||||
def __init__(self, aLoc) :
|
def __init__(self, aLoc) :
|
||||||
'''aLoc I2C pin location is either 1, 'X', 2 or'Y'.'''
|
'''aLoc I2C pin location is either 1, 'X', 2 or'Y'.'''
|
||||||
super(pca9865, self).__init__()
|
super(pca9865, self).__init__()
|
||||||
self.i2c = pyb.I2C(aLoc, pyb.I2C.MASTER)
|
self.i2c = machine.I2C(aLoc, machine.I2C.MASTER)
|
||||||
# print(self.i2c)
|
# print(self.i2c)
|
||||||
self._buffer = bytearray(4)
|
self._buffer = bytearray(4)
|
||||||
self._b1 = bytearray(1)
|
self._b1 = bytearray(1)
|
||||||
|
|
Ładowanie…
Reference in New Issue