add slave connect detection
This commit is contained in:
@@ -78,6 +78,8 @@ void ioHelperEdgeDetector(void);
|
|||||||
#define LED_ROT_NOTAUS_SCHRANK BitPE3
|
#define LED_ROT_NOTAUS_SCHRANK BitPE3
|
||||||
#define LED_PLC_OK BitPH5
|
#define LED_PLC_OK BitPH5
|
||||||
#define LED_BUS_OK BitPD4
|
#define LED_BUS_OK BitPD4
|
||||||
|
#define LED_KALTWASSER_DRAN_GR 23
|
||||||
|
#define LED_KALTWASSER_DRAN_RT 22
|
||||||
|
|
||||||
#define OUT_PUMPE_STARTSTOP BitPB5
|
#define OUT_PUMPE_STARTSTOP BitPB5
|
||||||
#define OUT_PUMPE_PWM BitPB6
|
#define OUT_PUMPE_PWM BitPB6
|
||||||
@@ -112,6 +114,6 @@ void ioHelperEdgeDetector(void);
|
|||||||
#define IN_NOTAUS_ANLAGE BitPinF7
|
#define IN_NOTAUS_ANLAGE BitPinF7
|
||||||
#define IN_NOTAUS_SCHRANK BitPinK0
|
#define IN_NOTAUS_SCHRANK BitPinK0
|
||||||
|
|
||||||
#define IN_KLATWASSER_DRAN BitPinF6
|
#define IN_KLATWASSER_DRAN 9
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
11
main.c
11
main.c
@@ -184,6 +184,17 @@ int main()
|
|||||||
timer_send_temps = millis();
|
timer_send_temps = millis();
|
||||||
send_temperatures();
|
send_temperatures();
|
||||||
printf("gefran: 0x%02X\n", gtf_firmware_version(5));
|
printf("gefran: 0x%02X\n", gtf_firmware_version(5));
|
||||||
|
|
||||||
|
if(read_Input(IN_KLATWASSER_DRAN, LEVEL)){
|
||||||
|
send_value(&mqtt_client, "/Filamentanlage/03_Wasserbecken/state/connected", 1);
|
||||||
|
set_Output(LED_KALTWASSER_DRAN_GR, 1);
|
||||||
|
set_Output(LED_KALTWASSER_DRAN_RT, 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
send_value(&mqtt_client, "/Filamentanlage/03_Wasserbecken/state/connected", 0);
|
||||||
|
set_Output(LED_KALTWASSER_DRAN_GR, 0);
|
||||||
|
set_Output(LED_KALTWASSER_DRAN_RT, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// send misc info
|
// send misc info
|
||||||
|
|||||||
Reference in New Issue
Block a user