updated py file

This commit is contained in:
Alexander Richter 2023-09-05 13:38:42 +02:00
parent d2270c0fc9
commit 95a35bb1c9

View File

@ -76,7 +76,10 @@ AInPinmap = [1] #Potentiometer connected to Pin 1 (A0)
# Set how many Latching Analog Inputs you have programmed in Arduino and how many latches there are, you can set as many as your Arduino has Analog pins. List the connected pins below.
LPoti = 0 #number of LPotis, Set LPoti = 0 to disable
SetLPotiValue = [1,2] #0 OFF - creates Pin for each Position
#1 S32 - Whole Number between -2147483648 to 2147483647
#2 FLOAT - 32 bit floating point value
LPotiLatches = [[1,9], #Poti is connected to Pin 1 (A1) and has 9 positions
[2,4]] #Poti is connected to Pin 2 (A2) and has 4 positions
@ -206,14 +209,15 @@ for port in range(PwmOutputs):
# setup Analog Input halpins
for port in range(AInputs):
c.newpin("ain.{}".format(AInPinmap[port]), hal.HAL_FLOAT, hal.HAL_OUT)
# setup Latching Poti halpins
for Poti in range(LPoti):
if SetLPotiValue[Poti]== 0:
if SetLPotiValue[Poti] == 0:
for Pin in range(LPotiLatches[Poti][1]):
c.newpin("lpoti.{}.{}" .format(LPotiLatches[Poti][0],Pin), hal.HAL_BIT, hal.HAL_OUT)
else:
c.newpin("lpoti.{}.{}" .format(LPotiLatches[Poti][0],"out"), hal.HAL_S32, hal.HAL_OUT)
c.newpin("LPoti.{}.{}" .format(LPotiLatches[Poti][0],Pin), hal.HAL_BIT, hal.HAL_OUT)
if SetLPotiValue[Poti] == 1:
c.newpin("LPoti.{}.{}" .format(LPotiLatches[Poti][0],"out"), hal.HAL_S32, hal.HAL_OUT)
if SetLPotiValue[Poti] == 2:
c.newpin("LPoti.{}.{}" .format(LPotiLatches[Poti][0],"out"), hal.HAL_FLOAT, hal.HAL_OUT)
# setup Absolute Encoder Knob halpins
if BinSelKnob: