update html

This commit is contained in:
Shuanglei Tao
2024-11-13 19:32:01 +08:00
parent de809d7531
commit bd5addaa70
9 changed files with 122 additions and 117 deletions

View File

@@ -36,7 +36,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'
path: 'html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -17,7 +17,7 @@
引脚映射0508090A0B0C0D
```
![](docs/images/1.jpg)
![](html/images/1.jpg)
- 老五 4.2 寸价签,黑白红三色版本
@@ -36,9 +36,9 @@
地址https://tsl0922.github.io/EPD-nRF51/
![](docs/images/0.jpg)
![](html/images/0.jpg)
本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `docs/index.html` 来使用。
本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `html/index.html` 来使用。
至于能不能使用,要看你打开这个页面的设备是否带有蓝牙硬件,还有使用的浏览器是否支持蓝牙接口。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 KiB

File diff suppressed because one or more lines are too long

BIN
html/images/0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

View File

Before

Width:  |  Height:  |  Size: 601 KiB

After

Width:  |  Height:  |  Size: 601 KiB

112
html/index.html Normal file

File diff suppressed because one or more lines are too long

View File

@@ -34,6 +34,8 @@ function handleError(error) {
async function sendCommand(cmd) {
if (writeCharacteristic) {
await writeCharacteristic.writeValue(cmd);
} else {
addLog("服务不可用,请检查蓝牙连接");
}
}
@@ -119,7 +121,10 @@ function preConnect() {
}
else {
connectTrys = 0;
navigator.bluetooth.requestDevice({ optionalServices: ['62750001-d828-918d-fb46-b6c11c675aec'], acceptAllDevices: true }).then(device => {
navigator.bluetooth.requestDevice({
optionalServices: ['62750001-d828-918d-fb46-b6c11c675aec'],
acceptAllDevices: true
}).then(device => {
device.addEventListener('gattserverdisconnected', disconnect);
bleDevice = device;
connect();
@@ -152,7 +157,6 @@ function connect() {
document.getElementById("connectbutton").innerHTML = '断开';
updateButtonStatus();
writeCharacteristic = characteristic;
return;
}).catch(handleError);
}
}