diff --git a/examples/modules/dual_motor/single_stepper.py b/examples/modules/dual_motor/single_stepper.py index d1e5e15..aa02331 100644 --- a/examples/modules/dual_motor/single_stepper.py +++ b/examples/modules/dual_motor/single_stepper.py @@ -1,7 +1,7 @@ from pimoroni_yukon import Yukon from pimoroni_yukon import SLOT1 as SLOT from pimoroni_yukon.modules import DualMotorModule -from pimoroni_yukon.extras.stepper import OkayStepper +from pimoroni_yukon.devices.stepper import OkayStepper """ Drive a stepper motor from a Dual Motor Module connected to Slot1. diff --git a/firmware/PIMORONI_YUKON/uf2-manifest.txt b/firmware/PIMORONI_YUKON/uf2-manifest.txt index 0091892..36ca348 100644 --- a/firmware/PIMORONI_YUKON/uf2-manifest.txt +++ b/firmware/PIMORONI_YUKON/uf2-manifest.txt @@ -1,6 +1,5 @@ ../*.py ../lib/*.py ../lib/pimoroni_yukon/*.py -../lib/pimoroni_yukon/extras/*.py +../lib/pimoroni_yukon/devices/*.py ../lib/pimoroni_yukon/modules/*.py -../lib/pimoroni_yukon/protocols/*.py \ No newline at end of file diff --git a/lib/pimoroni_yukon/extras/player.py b/lib/pimoroni_yukon/devices/audio.py similarity index 100% rename from lib/pimoroni_yukon/extras/player.py rename to lib/pimoroni_yukon/devices/audio.py diff --git a/lib/pimoroni_yukon/protocols/lx_servos.py b/lib/pimoroni_yukon/devices/lx_servo.py similarity index 99% rename from lib/pimoroni_yukon/protocols/lx_servos.py rename to lib/pimoroni_yukon/devices/lx_servo.py index 7cc3f63..ff2025c 100644 --- a/lib/pimoroni_yukon/protocols/lx_servos.py +++ b/lib/pimoroni_yukon/devices/lx_servo.py @@ -10,6 +10,13 @@ import pimoroni_yukon.logging as logging from ucollections import namedtuple +""" +Classes and functions for controlling LewanSoul/HiWonder +LX servos (tested on LX-16A and LX-224HV) via Yukon's +Serial Bus Servo module. +""" + + Command = namedtuple("Command", ("value", "length")) # LX Servo Protocol @@ -69,7 +76,7 @@ def checksum(buffer): def send(id, uart, duplexer, command, fmt="", *data): # Create a buffer of the correct length buffer = bytearray(FRAME_HEADER_LENGTH + command.length) - + # Populate the buffer with the required header values and command data struct.pack_into("