Merge branch 'master' of https://git.theater.digital/johannes.payr/pizzabox-ctrl
This commit is contained in:
commit
d9c9d673fc
1 changed files with 10 additions and 5 deletions
|
@ -59,8 +59,7 @@ class Scroll:
|
||||||
self.c += self._dir
|
self.c += self._dir
|
||||||
|
|
||||||
def _stop(self, pin):
|
def _stop(self, pin):
|
||||||
self.a_pin.value(0)
|
self.speed = 0
|
||||||
self.b_pin.value(0)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dir(self):
|
def dir(self):
|
||||||
|
@ -78,10 +77,10 @@ class Scroll:
|
||||||
|
|
||||||
@speed.setter
|
@speed.setter
|
||||||
def speed(self, speed):
|
def speed(self, speed):
|
||||||
self._speed = speed
|
|
||||||
self.en_pin.duty_u16(speed * (_PWM_MAX // 100))
|
self.en_pin.duty_u16(speed * (_PWM_MAX // 100))
|
||||||
self.dir = (1 if speed > 0 else
|
self.dir = (1 if speed > 0 else
|
||||||
(-1 if speed < 0 else 0))
|
(-1 if speed < 0 else 0))
|
||||||
|
self._speed = speed
|
||||||
|
|
||||||
pwm_bl = PWM(Pin(_PIN_EN_BACKLIGHT))
|
pwm_bl = PWM(Pin(_PIN_EN_BACKLIGHT))
|
||||||
pwm_bl.freq(_PWM_FREQ)
|
pwm_bl.freq(_PWM_FREQ)
|
||||||
|
@ -193,9 +192,14 @@ def recording(timeout):
|
||||||
time.sleep_ms(50)
|
time.sleep_ms(50)
|
||||||
return 'OK'
|
return 'OK'
|
||||||
|
|
||||||
|
|
||||||
def rewind(*opts):
|
def rewind(*opts):
|
||||||
print(f'rewind({opts})')
|
scroll_h.speed = -100
|
||||||
|
scroll_v.speed = -100
|
||||||
|
while (scroll_h.speed + scroll_v.speed) > 0:
|
||||||
|
time.sleep_ms(10)
|
||||||
|
scroll_h.c = 0
|
||||||
|
scroll_v.c = 0
|
||||||
|
return 'OK'
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
@ -205,6 +209,7 @@ choice_map = {
|
||||||
CMD_BL: backlight,
|
CMD_BL: backlight,
|
||||||
CMD_FL: frontlight,
|
CMD_FL: frontlight,
|
||||||
CMD_UI: user_interaction,
|
CMD_UI: user_interaction,
|
||||||
|
CMD_RC: recording,
|
||||||
CMD_RW: rewind
|
CMD_RW: rewind
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue