|
|
|
|
@ -86,7 +86,7 @@ void do_luefter(){
|
|
|
|
|
if (read_Input(BTN_LUEFTER_PLUS, RISING) && (fan_value+STEP_SIZE <= TOP_VALUE)) {
|
|
|
|
|
fan_value += STEP_SIZE;
|
|
|
|
|
#if PLC_MQTT_ENABLED
|
|
|
|
|
char _msg[4];
|
|
|
|
|
char _msg[3];
|
|
|
|
|
sprintf(_msg, "%d", fan_value * 100 / 40);
|
|
|
|
|
mqtt_pub(&mqtt_client, "/Filamentanlage/04_Messmodul/state/LuefterSpeed", _msg, 3);
|
|
|
|
|
#endif
|
|
|
|
|
@ -96,7 +96,7 @@ void do_luefter(){
|
|
|
|
|
if (read_Input(BTN_LUEFTER_MINUS, RISING) && (fan_value-STEP_SIZE >= STEP_SIZE)) {
|
|
|
|
|
fan_value -= STEP_SIZE;
|
|
|
|
|
#if PLC_MQTT_ENABLED
|
|
|
|
|
char _msg[4];
|
|
|
|
|
char _msg[3];
|
|
|
|
|
sprintf(_msg, "%d", fan_value * 100 / 40);
|
|
|
|
|
mqtt_pub(&mqtt_client, "/Filamentanlage/04_Messmodul/state/LuefterSpeed", _msg, 3);
|
|
|
|
|
#endif
|
|
|
|
|
@ -207,7 +207,7 @@ int main()
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("--MQTT Connected ERROR: %ld\r\n", mqtt_rc);
|
|
|
|
|
while(1); //Reboot the board
|
|
|
|
|
//while(1); //Reboot the board
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Subscribe to all topics
|
|
|
|
|
@ -222,10 +222,10 @@ int main()
|
|
|
|
|
uint32_t timer_blink_outs = millis();
|
|
|
|
|
uint32_t timer_send_uptime = millis();
|
|
|
|
|
|
|
|
|
|
OCR3B = 127;
|
|
|
|
|
|
|
|
|
|
#if PLC_MQTT_ENABLED
|
|
|
|
|
mqtt_pub(&mqtt_client, "/Filamentanlage/04_Messmodul/state/Luefter", "aus", 3);
|
|
|
|
|
mqtt_pub(&mqtt_client, "/Filamentanlage/04_Messmodul/state/LuefterSpeed", "50", 2);
|
|
|
|
|
mqtt_pub(&mqtt_client, "/Filamentanlage/04_Messmodul/state/Zumbach", "aus", 3);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
|
@ -299,7 +299,6 @@ void timer3_init(void)
|
|
|
|
|
TCCR3A |= (1<<WGM30); // PWM Mode with ocra top
|
|
|
|
|
TCCR3B |= (1<<WGM33);
|
|
|
|
|
OCR3A = TOP_VALUE;
|
|
|
|
|
OCR3B = 0;
|
|
|
|
|
|
|
|
|
|
TCCR3B |= (0<<CS32)|(1<<CS31)|(0<<CS30); // PS 1:1
|
|
|
|
|
TCCR3A |= (1<<COM3B1) | (0<<COM3B0);
|
|
|
|
|
|