-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
45 lines (43 loc) · 1.26 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<script src="./dist/bundle.js"></script>
</head>
<body>
<a href="#" onclick="connect();">Connect</a>
<a href="#" onclick="led();">Led</a>
<a href="#" onclick="drive();">Drive</a>
<a href="#" onclick="disconnect();">Disconnect</a>
<a href="#" onclick="ai();">AI</a>
<a href="#" onclick="stop();">Stop</a>
<a href="#" onclick="turnLeft();">TurnLeft</a>
<a href="#" onclick="turnRight();">TurnRight</a>
<a href="#" onclick="driveForward();">DriveForward</a>
<a href="#" onclick="driveBackward();">DriveBackward</a>
<a href="#" onclick="turnAPositive();">turnAPositive</a>
<a href="#" onclick="turnANegative();">turnANegative</a>
<a href="#" onclick="rawCommand();">RAW command (change LED)</a>
<a href="#" onclick="testAll();">TEST ALL</a>
</body>
<script>
console.log('Is Web Bluetooth supported: ' + isWebBluetoothSupported);
const funcs = [
led,
drive,
turnLeft,
turnRight,
driveForward,
driveBackward,
turnAPositive,
turnANegative,
rawCommand,
ai,
stop,
disconnect
];
const testAll = () => {
funcs.forEach((value, idx) => {
this.setTimeout(() => value(), idx * 2000);
});
};
</script>
</html>