Refactor IR polling parameters for improved performance

This commit is contained in:
Artem Kashaev 2025-12-26 14:23:06 +05:00
parent 5521d8da5d
commit 7a455bd6ec
2 changed files with 5 additions and 5 deletions

View File

@ -132,8 +132,8 @@ class IRRxTxPollPair:
@staticmethod @staticmethod
def _seen_to_state(seen: bool) -> int: def _seen_to_state(seen: bool) -> int:
# 1 = луч перекрыт, 0 = луч не перекрыт # 0 = луч перекрыт, 1 = луч не перекрыт
return 1 if seen else 0 return 0 if seen else 1
@property @property
def last_state(self) -> int | None: def last_state(self) -> int | None:

View File

@ -34,10 +34,10 @@ def load_seminsus():
seminsu = IRRxTxPollPair( seminsu = IRRxTxPollPair(
rx_pin=sem_cfg["pin_rx"], rx_pin=sem_cfg["pin_rx"],
tx_pin=sem_cfg["pin_tx"], tx_pin=sem_cfg["pin_tx"],
poll_period_ms=200, poll_period_ms=50,
tx_on_ms=10, tx_on_ms=3,
blinks_per_poll=10, blinks_per_poll=10,
blink_off_ms=5, blink_off_ms=2,
freq_hz=38_000, freq_hz=38_000,
duty_percent=33, duty_percent=33,
min_edges=10, min_edges=10,