Configured temperature display

This commit is contained in:
Tomislav Kopić 2024-11-01 21:08:03 +01:00
parent dea19d89d8
commit 7b67633bc9
3 changed files with 43 additions and 15 deletions

23
src/bitmaps.h Normal file
View File

@ -0,0 +1,23 @@
#include <avr/pgmspace.h>
const unsigned char bitmap_nozzle[] PROGMEM = {
0b00111100,
0b00111100,
0b00111100,
0b11111111,
0b11111111,
0b01111110,
0b00111100,
0b00011000
};
const unsigned char bitmap_bed[] PROGMEM = {
0b00100010,
0b01000100,
0b00100010,
0b01000100,
0b11111111,
0b11111111,
0b01100110,
0b00000000
};

View File

@ -4,6 +4,7 @@
#include <Adafruit_GFX.h> #include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h> #include <Adafruit_SSD1306.h>
#include "functions.h" #include "functions.h"
#include "bitmaps.h"
#include "octoprint.h" #include "octoprint.h"
void setup() { void setup() {

View File

@ -56,23 +56,27 @@ bool fetchPrintingStatus(Adafruit_SSD1306& display) {
display.setTextSize(1); display.setTextSize(1);
display.setTextColor(WHITE); display.setTextColor(WHITE);
display.println(api.printerStats.printerState); display.println(api.printerStats.printerState);
display.print("Nozzle: "); display.drawLine(0,10,127,10,WHITE);
display.println(api.printerStats.printerTool0TempActual); display.drawBitmap(10, 13, bitmap_nozzle, 8, 8, WHITE);
display.print("Bed: "); display.setCursor(21, 13);
display.println(api.printerStats.printerBedTempActual); display.print(api.printerStats.printerTool0TempActual);
display.drawBitmap(74, 13, bitmap_bed, 8, 8, WHITE);
display.setCursor(84, 13);
display.print(api.printerStats.printerBedTempActual);
display.setCursor(0, 15);
//Print time left (if printing) in human readable time HH:MM:SS // //Print time left (if printing) in human readable time HH:MM:SS
int runHours= api.printJob.progressPrintTimeLeft/3600; // int runHours= api.printJob.progressPrintTimeLeft/3600;
int secsRemaining=api.printJob.progressPrintTimeLeft%3600; // int secsRemaining=api.printJob.progressPrintTimeLeft%3600;
int runMinutes=secsRemaining/60; // int runMinutes=secsRemaining/60;
int runSeconds=secsRemaining%60; // int runSeconds=secsRemaining%60;
char buf[31]; // char buf[31];
sprintf(buf,"%02d:%02d:%02d",runHours,runMinutes,runSeconds); // sprintf(buf,"%02d:%02d:%02d",runHours,runMinutes,runSeconds);
display.println(buf); // display.println(buf);
const float temp_percent = floor(api.printJob.progressCompletion*100)/100; // const float temp_percent = floor(api.printJob.progressCompletion*100)/100;
display.print(temp_percent); // display.print(temp_percent);
display.println("%"); // display.println("%");
display.display(); display.display();
api_lasttime = millis(); // Update the last fetch time api_lasttime = millis(); // Update the last fetch time
return true; return true;