minor bugfixes
Status LED Joystick Pin
This commit is contained in:
parent
a62ebed7e5
commit
f45a9c0276
@ -172,7 +172,7 @@ Encoder Encoder1(31,33); //A,B Pin
|
||||
//#define JOYSTICK //Support of an Rotating Knob that was build in my Machine. It encodes 32 Positions with 5 Pins in Binary. This will generate 32 Pins in LinuxCNC Hal.
|
||||
#ifdef JOYSTICK
|
||||
const int JoySticks = 1; // Number of potentiometers connected
|
||||
const int JoyStickPins[JoySticks*2] = {A0, A1}; // Analog input pins for the potentiometers
|
||||
const int JoyStickPins[JoySticks*2] = {0, 1}; // Analog input pins for the potentiometers
|
||||
const int middleValue = 512; // Middle value of the potentiometer
|
||||
const int deadband = 20; // Deadband range around the middleValue
|
||||
const float scalingFactor = 0.01; // Scaling factor to control the impact of distanceFromMiddle
|
||||
@ -601,18 +601,15 @@ void StatLedErr(int offtime, int ontime){
|
||||
if(DLEDSTATUSLED == 1){
|
||||
controlDLED(StatLedPin, 1);}
|
||||
#endif
|
||||
#ifndef DLED
|
||||
digitalWrite(StatLedPin, HIGH);
|
||||
#endif
|
||||
if(DLEDSTATUSLED == 0){digitalWrite(StatLedPin, HIGH);}
|
||||
}
|
||||
if (newMillis - oldmillis >= offtime+ontime){{
|
||||
#ifdef DLED
|
||||
if(DLEDSTATUSLED == 1){
|
||||
controlDLED(StatLedPin, 0);}
|
||||
#endif
|
||||
#ifndef DLED
|
||||
digitalWrite(StatLedPin, LOW);
|
||||
#endif
|
||||
if(DLEDSTATUSLED == 0){digitalWrite(StatLedPin, LOW);}
|
||||
|
||||
oldmillis = newMillis;
|
||||
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ for port in range(AInputs):
|
||||
|
||||
# setup Latching Poti halpins
|
||||
for Poti in range(LPoti):
|
||||
if SetLPotiValue[port]== 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:
|
||||
@ -217,7 +217,7 @@ for Poti in range(LPoti):
|
||||
|
||||
# setup Absolute Encoder Knob halpins
|
||||
if BinSelKnob:
|
||||
if SetBinSelKnobValue == 0:
|
||||
if SetBinSelKnobValue[0] == 0:
|
||||
for port in range(BinSelKnobPos):
|
||||
c.newpin("binselknob.0.{}".format(port), hal.HAL_BIT, hal.HAL_OUT)
|
||||
else :
|
||||
|
Loading…
Reference in New Issue
Block a user