Simple display mode Update

简洁显示模式中加入数值滚动以及状态条
Simple display mode with numeric scrolling and status bar
This commit is contained in:
createskyblue
2020-08-16 18:07:19 +08:00
parent b57fc16fb9
commit adbd5b9976
2 changed files with 46 additions and 31 deletions

View File

@@ -1,7 +1,9 @@
# T12 Soldering Station based on ATmega328p
**!!! ERROR in the current revision: DO NOT USE D4 18V ZENER OR INPUT VOLTAGE MORE THAN 19V !!!**
**!!! 此版本存在一个设计错误不要使用D4 18V 的齐纳稳压二极管 或 输入电压超过19V !!! **
**!!! 此版本存在一个设计缺陷不要使用D4 18V 的齐纳稳压二极管 或 输入电压超过19V !!! **
# 1. Overview #
T12 Quick Heating Soldering Station featuring
@@ -51,12 +53,15 @@ Video from LHW-createskyblue (UI-v1.6L): https://b23.tv/LiOe54
![](https://image.lceda.cn/pullimage/dD94Lz6baKfVFCMcqzb7acjT7sRY7NwJ7NaJmOt9.gif)
![](https://image.lceda.cn/pullimage/zIsCozlXO0gjzfxcF4wCfAmhQwTKoQBLKd5zZtRd.gif)
![](https://image.lceda.cn/pullimage/cfhvmAOQPhwq7iCPhLvNDeRbOcbccIucCHhU2Abj.gif)
![](https://image.lceda.cn/pullimage/ij3I4sFpNrQPefPdkgIqGjraDEWEPJYjb4974HlC.gif)
![](https://image.lceda.cn/pullimage/OsLI0MkxMrv7w0GgVg1tZPt6CMrcyhoFSeOnWrzp.gif)
# 2. Power Supply Specification Requirements #
Choose a power supply with an output voltage between 16V and 24V which can provide an output current according to the table below. The power supply must be well stabilized. The current and power is determined by the resistance (R = 8 Ohm) of the heater.

View File

@@ -54,7 +54,7 @@
//关于界面-项目页面二维码
const unsigned char QRCode[] PROGMEM = { 0x00, 0x00, 0x3e, 0x0e, 0x7c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x0e, 0x7c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x0e, 0x7c, 0x0c, 0x00, 0x00, 0x1f, 0xfe, 0x3f, 0xc1, 0x8c, 0x0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ff, 0x1f, 0xfe, 0x30, 0x01, 0x83, 0x8f, 0xe0, 0xff, 0x18, 0x06, 0x31, 0xf1, 0x8f, 0x80, 0x03, 0xe7, 0x18, 0x06, 0x31, 0xf1, 0x8f, 0x80, 0x03, 0xe7, 0x18, 0x06, 0x31, 0xf1, 0x8f, 0x80, 0x03, 0xe7, 0x18, 0x06, 0x3f, 0xff, 0x83, 0x83, 0xe3, 0x1f, 0x18, 0x06, 0x3f, 0xff, 0x83, 0x83, 0xe3, 0x1f, 0x18, 0x06, 0x31, 0xfe, 0x73, 0x8f, 0x80, 0xf8, 0x18, 0x06, 0x31, 0xfe, 0x73, 0x8f, 0x80, 0xf8, 0x18, 0x06, 0x31, 0xfe, 0x73, 0x8f, 0x80, 0xf8, 0x1f, 0xfe, 0x31, 0xfe, 0x00, 0x0c, 0x60, 0xe7, 0x1f, 0xfe, 0x31, 0xfe, 0x00, 0x0c, 0x60, 0xe7, 0x00, 0x00, 0x31, 0xfe, 0x0c, 0x0f, 0x9f, 0xe0, 0x00, 0x00, 0x31, 0xfe, 0x0c, 0x0f, 0x9f, 0xe0, 0x00, 0x00, 0x31, 0xfe, 0x0c, 0x0f, 0x9f, 0xe0 };
//const unsigned char QRCode[] PROGMEM={0};
//ICO
//width:16,height:16
const unsigned char Tag[] PROGMEM = { 0x00, 0x00, 0x7e, 0x00, 0x7f, 0x00, 0x73, 0x80, 0x61, 0xc0, 0x61, 0xe0, 0x73, 0xf0, 0x3f, 0xf8, 0x1f, 0xfc, 0x0f, 0xfe, 0x07, 0xff, 0x03, 0xff, 0x01, 0xfe, 0x00, 0xfc, 0x00, 0x78, 0x00, 0x30 };
@@ -357,9 +357,9 @@ void Flip(bool Fmode) {
}
void setup() {
arduboy.begin();
arduboy.setFrameRate(15);
arduboy.setFrameRate(30);
//Serial.begin(9600);
//Serial.begin(115200);
// set the pin modes
pinMode(SENSOR_PIN, INPUT);
pinMode(VIN_PIN, INPUT);
@@ -734,38 +734,47 @@ void MainScreen() {
arduboy.setTextSize(4);
if (ShowTemp > 500) arduboy.print(F("000")); else arduboy.print(ShowTemp);
arduboy.drawRect(55, 16, 72, 32, 0);
arduboy.setTextSize(1);
//温度条
//框
arduboy.drawRect(1, 49, 102, 14, 0);
//条
if (ShowTemp <= 500) arduboy.fillRect(1, 49, map(ShowTemp, 0, 500, 2, 102), 14, 0);
//指示部分
arduboy.fillRect(map(Setpoint, 0, 500, 2, 102) - 2, 50, 3, 13, 0);
//先来个白底
arduboy.fillRect(map(Setpoint, 0, 500, 2, 102) - 3, 60, 5, 4, 0);
arduboy.drawLine(map(Setpoint, 0, 500, 2, 102) - 1, 60, map(Setpoint, 0, 500, 2, 102) - 1, 49);
//画指示针
arduboy.drawSlowXYBitmap(map(Setpoint, 0, 500, 2, 102) - 3, 59, Pointer, 5, 4, 1);
//功率条
arduboy.drawRect(104, 49, 23, 14, 0);
arduboy.fillRect(104, 49, map(Output, 255, 0, 0, 23), 14, 0);
SetTextColor(1);
//////////////进入反色////////////////////////////////
arduboy.setCursor(2, 55); arduboy.print(Setpoint, 0); arduboy.print((char)248); arduboy.print(F("C")); //探头预设温度
arduboy.setCursor(105, 55); arduboy.print(map(Output, 255, 0, 0, 100)); arduboy.print(F("%")); //功率百分比
DrawStatusBar(0);
arduboy.display();
} else {
if (ShowTemp > 500) DisplayNum(999); else DisplayNum(ShowTemp);;
arduboy.clear();
if (ShowTemp > 500) DisplayNum(999); else DisplayNum(ShowTemp);
arduboy.fillRect(0, 48, 128, 3, 0);
DrawStatusBar(1);
arduboy.display();
}
}
void DrawStatusBar(bool color) {
SetTextColor(color);
arduboy.setTextSize(1);
//温度条
//框
arduboy.drawRect(1, 49, 102, 14, color);
//条
if (ShowTemp <= 500) arduboy.fillRect(1, 49, map(ShowTemp, 0, 500, 2, 102), 14, color);
//指示部分
arduboy.fillRect(map(Setpoint, 0, 500, 2, 102) - 2, 50, 3, 13, color);
//先来个白底
arduboy.fillRect(map(Setpoint, 0, 500, 2, 102) - 3, 60, 5, 4, color);
arduboy.drawLine(map(Setpoint, 0, 500, 2, 102) - 1, 60, map(Setpoint, 0, 500, 2, 102) - 1, 49, !color);
//画指示针
arduboy.drawSlowXYBitmap(map(Setpoint, 0, 500, 2, 102) - 3, 59, Pointer, 5, 4, !color);
//功率条
arduboy.drawRect(104, 49, 23, 14, color);
arduboy.fillRect(104, 49, map(Output, 255, 0, 0, 23), 14, color);
SetTextColor(!color);
//////////////进入反色////////////////////////////////
arduboy.setCursor(2, 55); arduboy.print(Setpoint, 0); arduboy.print((char)248); arduboy.print(F("C")); //探头预设温度
arduboy.setCursor(105, 55); arduboy.print(map(Output, 255, 0, 0, 100)); arduboy.print(F("%")); //功率百分比
SetTextColor(color);
}
//设置画笔颜色
void SetTextColor(bool color) {
arduboy.setTextBackground(!color);
@@ -939,7 +948,7 @@ byte QueryMenuObject() {
//模拟数字滚轮 Numerical scrolling effect
void DisplayNum(int Num) {
arduboy.clear();
arduboy.setTextSize(6);
SetTextColor(0);
//数字滚轮
@@ -957,7 +966,6 @@ void DisplayNum(int Num) {
//刻度标
arduboy.fillRect(0, 0, 128, 2, 0); //上遮罩层
arduboy.fillRect(0, 51, 128, 13, 0); //下遮罩层
arduboy.display();
}
//数值输入界面
@@ -965,7 +973,9 @@ void DisplayNum(int Num) {
uint16_t InputScreen() {
lastbutton = (!digitalRead(BUTTON_PIN));
do {
arduboy.clear();
DisplayNum(getRotary());
arduboy.display();
CheckLastButton();
} while (digitalRead(BUTTON_PIN) || lastbutton);
beep();