send spool rpm
This commit is contained in:
15
main.c
15
main.c
@@ -73,6 +73,8 @@ static void avr_init()
|
|||||||
|
|
||||||
void send_info(void){
|
void send_info(void){
|
||||||
char msg[10];
|
char msg[10];
|
||||||
|
|
||||||
|
/* Abzug */
|
||||||
sprintf(msg, "%d", abzug_speed);
|
sprintf(msg, "%d", abzug_speed);
|
||||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/speed", msg, strlen(msg));
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/speed", msg, strlen(msg));
|
||||||
|
|
||||||
@@ -82,6 +84,7 @@ void send_info(void){
|
|||||||
sprintf(msg, "False");
|
sprintf(msg, "False");
|
||||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/onoff", msg, strlen(msg));
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/onoff", msg, strlen(msg));
|
||||||
|
|
||||||
|
/* Taenzer */
|
||||||
if(kraftsensor_valid)
|
if(kraftsensor_valid)
|
||||||
ltoa(kraftsensor_value, msg, 10);
|
ltoa(kraftsensor_value, msg, 10);
|
||||||
else
|
else
|
||||||
@@ -95,6 +98,18 @@ void send_info(void){
|
|||||||
itoa(taenzer_state.force_setpoint, msg, 10);
|
itoa(taenzer_state.force_setpoint, msg, 10);
|
||||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/taenzer/sp_kraft", msg, strlen(msg));
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/taenzer/sp_kraft", msg, strlen(msg));
|
||||||
|
|
||||||
|
|
||||||
|
/* Spule */
|
||||||
|
itoa((250*60)/ICR5, msg, 10);
|
||||||
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/spule/speed", msg, strlen(msg));
|
||||||
|
|
||||||
|
if(TCCR5B & (1<<CS31))
|
||||||
|
sprintf(msg, "True");
|
||||||
|
else
|
||||||
|
sprintf(msg, "False");
|
||||||
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/spule/onoff", msg, strlen(msg));
|
||||||
|
|
||||||
|
/* Uptime */
|
||||||
sprintf(msg, "%ld", millis()/1000);
|
sprintf(msg, "%ld", millis()/1000);
|
||||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/uptime", msg, strlen(msg));
|
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/uptime", msg, strlen(msg));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user