mirror of
https://github.com/pengwon/epd42.git
synced 2025-12-05 15:42:49 +08:00
update html
This commit is contained in:
2
.github/workflows/static.yml
vendored
2
.github/workflows/static.yml
vendored
@@ -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
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
引脚映射:0508090A0B0C0D
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
- 老五 4.2 寸价签,黑白红三色版本
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
地址:https://tsl0922.github.io/EPD-nRF51/
|
||||
|
||||

|
||||

|
||||
|
||||
本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `docs/index.html` 来使用。
|
||||
本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `html/index.html` 来使用。
|
||||
|
||||
至于能不能使用,要看你打开这个页面的设备是否带有蓝牙硬件,还有使用的浏览器是否支持蓝牙接口。
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 472 KiB |
111
docs/index.html
111
docs/index.html
File diff suppressed because one or more lines are too long
BIN
html/images/0.jpg
Normal file
BIN
html/images/0.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 402 KiB |
|
Before Width: | Height: | Size: 601 KiB After Width: | Height: | Size: 601 KiB |
112
html/index.html
Normal file
112
html/index.html
Normal file
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user