Compare commits

...

2 Commits

Author SHA1 Message Date
Elizabeth Cray d772ecfa71 Add OLED health function 2023-06-08 00:04:08 -04:00
Elizabeth Cray a8fd9abd49 Prepare for adding socket connection 2023-06-08 00:01:15 -04:00
1 changed files with 21 additions and 1 deletions

View File

@ -16,11 +16,19 @@
#include "config.h"
U8G2_SSD1309_128X64_NONAME2_1_4W_HW_SPI disp(U8G2_R0, /* cs=*/ 15, /* dc=*/ 2, /* reset=*/ 16);
double progress = 0;
// Socket data variables
double progress = 0.0;
uint64 timeRemaining = 0;
uint64 timeElapsed = 0;
uint8 hotendTemp = 0;
uint8 buildPlateTemp = 0;
// TODO:
// 1. Add WPA2 and connect QR to display
// "WIFI:S:"+ssid+";T:WPA;P:"+pass+";;"
// 2. Use config.h for printer spec for now
// 3. Add webfig menu for selecting a printer
void statusMsg(String msg){
disp.firstPage();
@ -29,6 +37,14 @@ void statusMsg(String msg){
}while ( disp.nextPage() );
}
void screenRefresh(){
// Fill screen
disp.setDrawColor(0);
disp.drawBox(0, 0, 128, 64);
delay(20);
disp.setDrawColor(1);
}
void configModeCallback (WiFiManager *myWiFiManager) {
Serial.println("Entered config mode");
statusMsg("Setup");
@ -143,6 +159,10 @@ void loop(void) {
disp.setDrawColor(1);
drawUI();
drawProgress();
if(millis() % 500 <= 2){
Serial.println("Refreshing");
screenRefresh();
}
}while ( disp.nextPage() );
// TODO: Replace this with data fetch