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){
|
||||
char msg[10];
|
||||
|
||||
/* Abzug */
|
||||
sprintf(msg, "%d", abzug_speed);
|
||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/speed", msg, strlen(msg));
|
||||
|
||||
@@ -82,6 +84,7 @@ void send_info(void){
|
||||
sprintf(msg, "False");
|
||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/abzug/onoff", msg, strlen(msg));
|
||||
|
||||
/* Taenzer */
|
||||
if(kraftsensor_valid)
|
||||
ltoa(kraftsensor_value, msg, 10);
|
||||
else
|
||||
@@ -95,6 +98,18 @@ void send_info(void){
|
||||
itoa(taenzer_state.force_setpoint, msg, 10);
|
||||
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);
|
||||
mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/uptime", msg, strlen(msg));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user