1
0

feat: 添加 lcdSetDirection 函数

This commit is contained in:
2026-02-24 13:22:37 +08:00
parent cb976ed0d9
commit b8d74ff0f5

View File

@@ -566,6 +566,25 @@ window.addEventListener('DOMContentLoaded', () => {
}
/**
* @description 设置显示方向
* @param {0|1} direction 显示方向
* - 0正常1上下翻转
*/
async function lcdSetDirection(direction = 0) {
let hexUse = [];
hexUse.push(2); // LCD 多次写入命令
hexUse.push(3); // 设置指令
hexUse.push(10); // 显示方向指令
hexUse.push(direction);
hexUse.push(0, 0);
await sendData(hexUse);
}
/** 设置 LCD 显示起始坐标 */
function lcdSetDisplayXY(lcdD0 = 0, lcdD1 = 0) {
let hexUse = [];
@@ -1250,4 +1269,9 @@ window.addEventListener('DOMContentLoaded', () => {
})();
// 调试
(function () {
window.lcdSetDirection = lcdSetDirection;
})();
});