feat: 添加 lcdSetDirection 函数
This commit is contained in:
@@ -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 显示起始坐标 */
|
/** 设置 LCD 显示起始坐标 */
|
||||||
function lcdSetDisplayXY(lcdD0 = 0, lcdD1 = 0) {
|
function lcdSetDisplayXY(lcdD0 = 0, lcdD1 = 0) {
|
||||||
let hexUse = [];
|
let hexUse = [];
|
||||||
@@ -1250,4 +1269,9 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// 调试
|
||||||
|
(function () {
|
||||||
|
window.lcdSetDirection = lcdSetDirection;
|
||||||
|
})();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user