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