#define rotMotRel 7
#define spreadMotRel 6
#define compMotRel 5
#define ashMotRel 4
#define conLed1Pin 15 // Buchse 15, viol (Control Led 1)
#define conLed2Pin 17 // Buchse 15, rosa (Control Led 2)
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(rotMotRel, INPUT_PULLUP);
pinMode(spreadMotRel, INPUT_PULLUP);
pinMode(compMotRel, INPUT_PULLUP);
pinMode(ashMotRel, INPUT_PULLUP);
pinMode(conLed1Pin, OUTPUT);
pinMode(conLed2Pin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
conLed();
//serial();
}
void conLed(){
// ash Led 1
// rot Led 2
// spread Led 2
// comp Led 1 & 2
//-----------------AN-------------- AN -------------AN--------------
if (digitalRead(rotMotRel) == LOW or // invers
digitalRead(spreadMotRel) == LOW or // invers
digitalRead(compMotRel) == HIGH ){ // nicht invers
digitalWrite(conLed2Pin, HIGH); // Control LED2 ein
}
//------------------ AUS ---------------------AUS ----------------------
if (digitalRead(rotMotRel) == HIGH && // invers
digitalRead(spreadMotRel) == HIGH && // invers
digitalRead(compMotRel) == LOW ){ // nicht invers
digitalWrite(conLed2Pin, LOW); // Control LED2 aus
}
//-----------------AN--------------------------AN--------------
if (digitalRead(ashMotRel) == LOW or // invers
digitalRead(compMotRel) == HIGH ){ // nicht invers
digitalWrite(conLed1Pin, HIGH); // Control LED1 ein
}
//------------------ AUS ---------------------AUS ----------------------
if (digitalRead(ashMotRel) == HIGH && // invers
digitalRead(compMotRel) == LOW ){ // nicht invers
digitalWrite(conLed1Pin, LOW); // Control LED2 aus
}
}
//-----------------------------------------------------------
void serial(){
/*
Serial.print("loadProzIsRun: ");
Serial.print(loadProzIsRun);
Serial.print(" kapSens4State: ");
Serial.print(kapSens4State);
Serial.print(" kapSens4: ");
Serial.print(kapSens4);
Serial.print(" spreadMotSwL: ");
Serial.println(spreadMotSwL);
//Serial.print("spreadMotSwL: ");
//Serial.println(rotCount);
*/
}