spi firmware

This commit is contained in:
Devaev Maxim
2020-11-03 10:15:54 +03:00
parent a3707d047f
commit e07cdd60f3
15 changed files with 254 additions and 195 deletions

View File

@@ -34,12 +34,12 @@ from . import aiotools
# =====
async def pulse(line: gpiod.Line, delay: float, final: float) -> None:
async def pulse(line: gpiod.Line, delay: float, final: float, inverted: bool=False) -> None:
try:
line.set_value(1)
line.set_value(int(not inverted))
await asyncio.sleep(delay)
finally:
line.set_value(0)
line.set_value(int(inverted))
await asyncio.sleep(final)