From 9ae56ab73c30579107145ec6e4fe1960a790675b Mon Sep 17 00:00:00 2001 From: Alexander Richter Date: Sat, 26 Nov 2022 01:15:46 +0100 Subject: [PATCH] Python Code now working, needs further testing --- arduino.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arduino.py b/arduino.py index b986147..26ab583 100755 --- a/arduino.py +++ b/arduino.py @@ -205,15 +205,20 @@ while True: firstcom = 1 c["aIn.{}".format(io)] = value if (Debug):print("aIn.{}:{}".format(io,value)) + elif cmd == "L": firstcom = 1 - if port == value: - c["AbsKnob.{}".format(port)] = 1 - if(Debug):print("AbsKnob.{}:{}".format(port,1)) - else: - c["AbsKnob.{}".format(port)] = 0 - if(Debug):print("AbsKnob.{}:{}".format(port,0)) - + + for Poti in range(LPoti): + if LPotiLatches[Poti][0] == io: + for Pin in range(LPotiLatches[Poti][1]): + if Pin == value: + c["LPoti.{}.{}" .format(io,Pin)] = 1 + if(Debug):print("LPoti.{}.{} =1".format(io,Pin)) + else: + c["LPoti.{}.{}" .format(io,Pin)] = 0 + if(Debug):print("LPoti.{}.{} =0".format(io,Pin)) + elif cmd == "K": firstcom = 1 for port in range(AbsKnobPos):