This commit is contained in:
2024-05-14 20:29:32 -05:00
parent 32260595a1
commit fa25b2c8b1
3 changed files with 17 additions and 9 deletions

8
run.py
View File

@@ -483,18 +483,20 @@ def get_sensors():
val = val[0]
if val == 1 and sensors[idx] >= 0: # skip negative values
sensors[idx] += 1
else:
elif val == 0:
if sensors[idx] >= 4:
sensors[idx] -= 4
else:
sensors[idx] += 4
else:
out = [0, 0, 0, 0]
sensors = [0, 0, 0, 0]
#fprint("Values: " + str(sensors))
#mbconn.close()
for x in range(len(sensors)):
if sensors[x] >= 180: # 3 sec
# cable newly detected on tray
sensors[x] = -10000
sensors[x] = -180
fprint("Precense detected: slot " + str(x))
return x