更明显的报错提示

This commit is contained in:
createskyblue
2020-11-14 17:42:50 +08:00
parent d4edca579c
commit 466a6bd537
2 changed files with 46 additions and 17 deletions

View File

@@ -6,12 +6,12 @@ void ViewEEPRom() {
arduboy.clear(); arduboy.clear();
for (byte y = 0; y < 8; y++) { for (byte y = 0; y < 8; y++) {
for (byte x = 0; x < 2; x++) { for (byte x = 0; x < 2; x++) {
if (2 * y + x > 1024) break; if (2 * y + x + getRotary() > 1024) break;
arduboy.setCursor(x * 64, y * 8); arduboy.setCursor(x * 64, y * 8);
arduboy.print(2 * y + x + getRotary()); arduboy.print(2 * y + x + getRotary());
arduboy.print(F("->")); arduboy.print(F("->"));
arduboy.print(EEPROM[2 * y + x + getRotary()]); arduboy.print(EEPROM[2 * y + x + getRotary()]);
arduboy.setCursor(x * 64 + 48, y * 8); arduboy.setCursor(x * 64 + 54, y * 8);
arduboy.print((char)EEPROM[2 * y + x + getRotary()]); arduboy.print((char)EEPROM[2 * y + x + getRotary()]);
} }
} }

View File

@@ -536,14 +536,15 @@ void CalibrationScreen() {
SetTemp = getRotary(); SetTemp = getRotary();
Thermostat(1); //加热控制 - ADC数值为基准 Thermostat(1); //加热控制 - ADC数值为基准
arduboy.setCursor(8, 0); arduboy.setCursor(25, 0);
arduboy.print(F("Cal ADC-> ")); SetTextColor(0);
arduboy.print(F("ADC-> "));
arduboy.print(RawTemp); arduboy.print(RawTemp);
SetTextColor(1);
for (byte y = 0; y < 5; y++) { for (byte y = 0; y < 5; y++) {
for (byte x = 0; x < 2; x++) { for (byte x = 0; x < 2; x++) {
if (2 * y + x > CalStep) break; if (2 * y + x > CalStep) break;
arduboy.setCursor(x * 64 + 4, y * 8 + 16); arduboy.setCursor(x * 64 + 10, y * 8 + 16);
arduboy.print(CalTemp[2 * y + x]); arduboy.print(CalTemp[2 * y + x]);
arduboy.print(F(" - ")); arduboy.print(F(" - "));
if (2 * y + x == CalStep) arduboy.print(getRotary()); if (2 * y + x == CalStep) arduboy.print(getRotary());
@@ -579,14 +580,21 @@ void CalibrationScreen() {
} }
} else { } else {
arduboy.clear(); arduboy.clear();
arduboy.setCursor(0, 24); arduboy.print(F("ERROR")); arduboy.setTextSize(2);
SetTextColor(0);
arduboy.setCursor(32, 24);
arduboy.print(F("Error"));
arduboy.display(); arduboy.display();
delay(5000); delay(5000);
resetFunc();
} }
arduboy.clear(); arduboy.clear();
arduboy.print(F("Reboot...")); arduboy.setTextSize(2);
SetTextColor(0);
arduboy.setCursor(28, 24);
arduboy.print(F("Reboot"));
arduboy.display(); arduboy.display();
delay(500); delay(5000);
resetFunc(); resetFunc();
} }
//显示默认烙铁头温度曲线系数 //显示默认烙铁头温度曲线系数
@@ -606,14 +614,14 @@ void ShowPTemp(float *p) {
lastbutton = (!digitalRead(BUTTON_PIN)); lastbutton = (!digitalRead(BUTTON_PIN));
while (digitalRead(BUTTON_PIN) || lastbutton) CheckLastButton(); while (digitalRead(BUTTON_PIN) || lastbutton) CheckLastButton();
/* /*
lastbutton = (!digitalRead(BUTTON_PIN)); lastbutton = (!digitalRead(BUTTON_PIN));
setRotary(50, 450, 1, 0); setRotary(50, 450, 1, 0);
do { do {
arduboy.clear(); arduboy.clear();
for (int y = 0; y < 64; y++) arduboy.drawPixel(map(calculateTemp(map(y, 0, 63, 0, 400)), CalTemp[0], CalTemp[8], 0, 127), y,1); for (int y = 0; y < 64; y++) arduboy.drawPixel(map(calculateTemp(map(y, 0, 63, 0, 400)), CalTemp[0], CalTemp[8], 0, 127), y,1);
arduboy.display(); arduboy.display();
CheckLastButton(); CheckLastButton();
} while (digitalRead(BUTTON_PIN) || lastbutton);*/ } while (digitalRead(BUTTON_PIN) || lastbutton);*/
} }
//命名界面 文本输入界面 //命名界面 文本输入界面
// input tip name screen // input tip name screen
@@ -655,7 +663,13 @@ void InputNameScreen() {
void DeleteTipScreen() { void DeleteTipScreen() {
MenuLevel = 7; MenuLevel = 7;
if (NumberOfTips == 1) { if (NumberOfTips == 1) {
//MessageScreen(DeleteMessage, sizeof(DeleteMessage)); arduboy.clear();
arduboy.setTextSize(2);
SetTextColor(0);
arduboy.setCursor(16, 24);
arduboy.print(F("Only one"));
arduboy.display();
delay(1000);
} }
else if (MenuScreen(0)) { else if (MenuScreen(0)) {
if (CurrentTip == (NumberOfTips - 1)) { if (CurrentTip == (NumberOfTips - 1)) {
@@ -677,8 +691,16 @@ void AddTipScreen() {
PTemp[1] = TempP2; PTemp[1] = TempP2;
PTemp[2] = TempP3; PTemp[2] = TempP3;
PTemp[3] = TempP4; PTemp[3] = TempP4;
UpdateEEPROM();
} else {
arduboy.clear();
SetTextColor(0);
arduboy.setCursor(5, 24);
arduboy.print(F("Out of Mem"));
arduboy.display();
delay(1000);
} }
UpdateEEPROM();
} }
int InputBigNum(int InputPW, byte appID) { int InputBigNum(int InputPW, byte appID) {
@@ -721,8 +743,15 @@ void Flip(bool Fmode) {
//展示版本号 //展示版本号
void ShowVersion() { void ShowVersion() {
arduboy.clear(); arduboy.clear();
arduboy.setCursor(43, 28); arduboy.setTextSize(2);
arduboy.setCursor(28, 24);
arduboy.print(F(VERSION)); arduboy.print(F(VERSION));
arduboy.display(); arduboy.display();
delay(1000); delay(700);
arduboy.clear();
SetTextColor(0);
arduboy.setCursor(28, 24);
arduboy.print(F(VERSION));
arduboy.display();
delay(300);
} }