finally fixed the DLED instability Bug
This commit is contained in:
parent
b89c15434e
commit
a62ebed7e5
@ -322,9 +322,7 @@ const int debounceDelay = 50;
|
|||||||
long EncCount[QuadEncs];
|
long EncCount[QuadEncs];
|
||||||
long OldEncCount[QuadEncs];
|
long OldEncCount[QuadEncs];
|
||||||
#endif
|
#endif
|
||||||
#ifdef DLED
|
|
||||||
int DLEDstate[DLEDcount];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef JOYSTICK
|
#ifdef JOYSTICK
|
||||||
long counter[JoySticks*2] = {0}; // Initialize an array for the counters
|
long counter[JoySticks*2] = {0}; // Initialize an array for the counters
|
||||||
@ -464,25 +462,8 @@ void loop() {
|
|||||||
readJoySticks(); //read Encoders & send data
|
readJoySticks(); //read Encoders & send data
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DLED
|
|
||||||
//updateDLEDs(); //read Encoders & send data
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DLED
|
|
||||||
void updateDLEDs(){
|
|
||||||
for(int i = 0; i< DLEDcount; i++){
|
|
||||||
controlDLED(i, DLEDstate[i]);
|
|
||||||
//update all DLEDs regulary
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef JOYSTICK
|
#ifdef JOYSTICK
|
||||||
|
|
||||||
@ -836,9 +817,7 @@ void commandReceived(char cmd, uint16_t io, uint16_t value){
|
|||||||
#endif
|
#endif
|
||||||
#ifdef DLED
|
#ifdef DLED
|
||||||
if(cmd == 'D'){
|
if(cmd == 'D'){
|
||||||
DLEDstate[io] = value;
|
controlDLED(io,value);
|
||||||
updateDLEDs();
|
|
||||||
//controlDLED(io,value);
|
|
||||||
lastcom=millis();
|
lastcom=millis();
|
||||||
#ifdef debug
|
#ifdef debug
|
||||||
Serial.print("DLED:");
|
Serial.print("DLED:");
|
||||||
|
@ -298,6 +298,7 @@ def managageOutputs():
|
|||||||
arduino.write(command.encode())
|
arduino.write(command.encode())
|
||||||
if (Debug):print ("Sending:{}".format(command.encode()))
|
if (Debug):print ("Sending:{}".format(command.encode()))
|
||||||
oldPwmOutStates[port]= State
|
oldPwmOutStates[port]= State
|
||||||
|
time.sleep(0.01)
|
||||||
|
|
||||||
for port in range(Outputs):
|
for port in range(Outputs):
|
||||||
State = int(c["dout.{}".format(OutPinmap[port])])
|
State = int(c["dout.{}".format(OutPinmap[port])])
|
||||||
@ -308,6 +309,7 @@ def managageOutputs():
|
|||||||
arduino.write(command.encode())
|
arduino.write(command.encode())
|
||||||
if (Debug):print ("Sending:{}".format(command.encode()))
|
if (Debug):print ("Sending:{}".format(command.encode()))
|
||||||
olddOutStates[port]= State
|
olddOutStates[port]= State
|
||||||
|
time.sleep(0.01)
|
||||||
|
|
||||||
for dled in range(DLEDcount):
|
for dled in range(DLEDcount):
|
||||||
State = int(c["dled.{}".format(dled)])
|
State = int(c["dled.{}".format(dled)])
|
||||||
@ -318,6 +320,7 @@ def managageOutputs():
|
|||||||
arduino.write(command.encode())
|
arduino.write(command.encode())
|
||||||
if (Debug):print ("Sending:{}".format(command.encode()))
|
if (Debug):print ("Sending:{}".format(command.encode()))
|
||||||
oldDLEDStates[dled] = State
|
oldDLEDStates[dled] = State
|
||||||
|
time.sleep(0.01)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user