updated py file
This commit is contained in:
parent
d2270c0fc9
commit
95a35bb1c9
@ -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.
|
# 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
|
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
|
[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
|
# setup Analog Input halpins
|
||||||
for port in range(AInputs):
|
for port in range(AInputs):
|
||||||
c.newpin("ain.{}".format(AInPinmap[port]), hal.HAL_FLOAT, hal.HAL_OUT)
|
c.newpin("ain.{}".format(AInPinmap[port]), hal.HAL_FLOAT, hal.HAL_OUT)
|
||||||
|
|
||||||
# setup Latching Poti halpins
|
# setup Latching Poti halpins
|
||||||
for Poti in range(LPoti):
|
for Poti in range(LPoti):
|
||||||
if SetLPotiValue[Poti]== 0:
|
if SetLPotiValue[Poti] == 0:
|
||||||
for Pin in range(LPotiLatches[Poti][1]):
|
for Pin in range(LPotiLatches[Poti][1]):
|
||||||
c.newpin("lpoti.{}.{}" .format(LPotiLatches[Poti][0],Pin), hal.HAL_BIT, hal.HAL_OUT)
|
c.newpin("LPoti.{}.{}" .format(LPotiLatches[Poti][0],Pin), hal.HAL_BIT, hal.HAL_OUT)
|
||||||
else:
|
if SetLPotiValue[Poti] == 1:
|
||||||
c.newpin("lpoti.{}.{}" .format(LPotiLatches[Poti][0],"out"), hal.HAL_S32, hal.HAL_OUT)
|
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
|
# setup Absolute Encoder Knob halpins
|
||||||
if BinSelKnob:
|
if BinSelKnob:
|
||||||
|
Loading…
Reference in New Issue
Block a user