Display Filament Sensor data on 20x4 LCD

Changes to support displaying the real-time filament width and the
volume factor on a 20x4 LCD.  The data is displayed on the 4th line.
First the status message is displayed for 5 seconds, and then the
filament data is displayed.  The status message can be seen by
re-selecting the info screen in the menu.
This commit is contained in:
Filip Mulier
2014-11-10 21:43:58 -06:00
parent df7c80335a
commit d84934d8c5
4 changed files with 52 additions and 2 deletions

View File

@ -20,6 +20,12 @@ int absPreheatHPBTemp;
int absPreheatFanSpeed;
#ifdef FILAMENT_LCD_DISPLAY
unsigned long message_millis=0;
#endif
#ifdef ULTIPANEL
static float manual_feedrate[] = MANUAL_FEEDRATE;
#endif // ULTIPANEL
@ -195,6 +201,9 @@ static void lcd_status_screen()
encoderPosition = 0;
lcd_quick_feedback();
lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it.
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
#ifdef ULTIPANEL_FEEDMULTIPLY
@ -1321,6 +1330,9 @@ void lcd_setstatus(const char* message)
return;
strncpy(lcd_status_message, message, LCD_WIDTH);
lcdDrawUpdate = 2;
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
void lcd_setstatuspgm(const char* message)
{
@ -1328,6 +1340,9 @@ void lcd_setstatuspgm(const char* message)
return;
strncpy_P(lcd_status_message, message, LCD_WIDTH);
lcdDrawUpdate = 2;
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
void lcd_setalertstatuspgm(const char* message)
{
@ -1515,6 +1530,20 @@ char *ftostr32(const float &x)
return conv;
}
//Float to string with 1.23 format
char *ftostr12ns(const float &x)
{
long xx=x*100;
xx=abs(xx);
conv[0]=(xx/100)%10+'0';
conv[1]='.';
conv[2]=(xx/10)%10+'0';
conv[3]=(xx)%10+'0';
conv[4]=0;
return conv;
}
char *itostr31(const int &xx)
{
conv[0]=(xx>=0)?'+':'-';