Add configuration for semaphore signals and implement railway signal control
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from machine import Pin
|
||||
|
||||
|
||||
class DoubleIr:
|
||||
def __init__(self, id: int, pin: Pin):
|
||||
self.id = id
|
||||
self.pin = pin
|
||||
self.last_state = pin.value()
|
||||
|
||||
def check(self):
|
||||
val = self.pin.value()
|
||||
if val != self.last_state:
|
||||
self.last_state = val
|
||||
print(f"EVENT IK_MODULE {self.id} {val}")
|
||||
Reference in New Issue
Block a user