From d713a5e2e9be7d4b443f30f96086fc253c63bc4e Mon Sep 17 00:00:00 2001 From: jpunkt Date: Tue, 18 Jan 2022 20:41:46 +0100 Subject: [PATCH] implemented motor speeds. --- pizzactrl/hal_serial.py | 4 +++- pizzactrl/storyboard.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pizzactrl/hal_serial.py b/pizzactrl/hal_serial.py index 9627949..a1cdc94 100644 --- a/pizzactrl/hal_serial.py +++ b/pizzactrl/hal_serial.py @@ -169,6 +169,7 @@ class PizzaHAL: def set_movement(hal: PizzaHAL, scroll: Scrolls, steps: int, + speed: int, **kwargs): """ Move the motor controlling the vertical scroll a given distance. @@ -177,7 +178,8 @@ def set_movement(hal: PizzaHAL, scroll = int(scroll.value) hal.send_cmd(SerialCommands.SET_MOVEMENT, scroll.to_bytes(1, 'little', signed=False), - steps.to_bytes(2, 'little', signed=True)) + steps.to_bytes(2, 'little', signed=True), + speed.to_bytes(1, 'little', signed=False)) def rewind(hal: PizzaHAL, **kwargs): diff --git a/pizzactrl/storyboard.py b/pizzactrl/storyboard.py index e934b9f..dfd6029 100644 --- a/pizzactrl/storyboard.py +++ b/pizzactrl/storyboard.py @@ -66,9 +66,11 @@ class Activity(Enum): 'filename': ''} TAKE_PHOTO = {'filename': ''} ADVANCE_UP = {'steps': 100, - 'scroll': Scrolls.VERTICAL} + 'scroll': Scrolls.VERTICAL, + 'speed': 4} ADVANCE_LEFT = {'steps': 200, - 'scroll': Scrolls.HORIZONTAL} + 'scroll': Scrolls.HORIZONTAL, + 'speed': 4} LIGHT_FRONT = {'r': 0, 'g': 0, 'b': 0,