Commit 1d46ad77 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

test pulse

Showing with 23 additions and 0 deletions
+23 -0
......@@ -80,6 +80,29 @@ class Tx(Tx_mb_2023):
Tx_mb_2023.inject(self, polarity=polarity, injection_duration=injection_duration)
self.pin6.value = False
@property
def polarity(self):
return self._polarity
@polarity.setter
def polarity(self, polarity):
print(polarity)
assert polarity in [-1, 0, 1]
print(f'asserted polarity: {self.polarity}')
self._polarity = polarity
if polarity == 1:
self.pin0.value = True
self.pin1.value = False
time.sleep(self._activation_delay)
elif polarity == -1:
self.pin0.value = False
self.pin1.value = True
time.sleep(self._activation_delay)
else:
self.pin0.value = False
self.pin1.value = False
time.sleep(self._release_delay)
class Rx(Rx_mb_2023):
def __init__(self, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment