Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
d772ecfa71 | |||
a8fd9abd49 |
22
src/main.cpp
22
src/main.cpp
@ -16,11 +16,19 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
U8G2_SSD1309_128X64_NONAME2_1_4W_HW_SPI disp(U8G2_R0, /* cs=*/ 15, /* dc=*/ 2, /* reset=*/ 16);
|
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:
|
// TODO:
|
||||||
// 1. Add WPA2 and connect QR to display
|
// 1. Add WPA2 and connect QR to display
|
||||||
// "WIFI:S:"+ssid+";T:WPA;P:"+pass+";;"
|
// "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){
|
void statusMsg(String msg){
|
||||||
disp.firstPage();
|
disp.firstPage();
|
||||||
@ -29,6 +37,14 @@ void statusMsg(String msg){
|
|||||||
}while ( disp.nextPage() );
|
}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) {
|
void configModeCallback (WiFiManager *myWiFiManager) {
|
||||||
Serial.println("Entered config mode");
|
Serial.println("Entered config mode");
|
||||||
statusMsg("Setup");
|
statusMsg("Setup");
|
||||||
@ -143,6 +159,10 @@ void loop(void) {
|
|||||||
disp.setDrawColor(1);
|
disp.setDrawColor(1);
|
||||||
drawUI();
|
drawUI();
|
||||||
drawProgress();
|
drawProgress();
|
||||||
|
if(millis() % 500 <= 2){
|
||||||
|
Serial.println("Refreshing");
|
||||||
|
screenRefresh();
|
||||||
|
}
|
||||||
}while ( disp.nextPage() );
|
}while ( disp.nextPage() );
|
||||||
|
|
||||||
// TODO: Replace this with data fetch
|
// TODO: Replace this with data fetch
|
||||||
|
Loading…
Reference in New Issue
Block a user