-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmicrobit-web-bluetooth-temperature.html
More file actions
23 lines (23 loc) · 1.39 KB
/
microbit-web-bluetooth-temperature.html
File metadata and controls
23 lines (23 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<title>Web Bluetooth micro:bit Temperature</title>
<h1>Web Bluetooth micro:bit Temperature</h1>
<p>Scan Bluetooth devices (using "BBC micro:bit" as namePrefix filter). Allows to interact with the micro:bit using the Bluetooth Temperature service.<br>Example MakeCode micro:bit project <a href="https://makecode.microbit.org/_9j6X6abjUMyP" target="_blank">here</a> (or <a href="https://makecode.microbit.org/#pub:_9j6X6abjUMyP" target="_blank">here</a> to open in MakeCode directly).</p>
</head>
<body id="body" style="background-color:#FFD0D0">
<button onclick="connect()">Connect</button>
<button onclick="disconnect()">Disconnect</button>
<h2>Temperature (°C)</h2>
<p id="temperature">-</p>
<h2>Temperature Period (ms)</h2>
<input type="text" id="readTemperaturePeriodText" disabled="true">
<button id="readTemperaturePeriodButton" onclick="readTemperaturePeriod()">Read</button>
<br>
<input type="text" id="writeTemperaturePeriodText">
<button id="writeTemperaturePeriodButton" onclick="writeTemperaturePeriod()">Write</button>
<h2>Log <button id="clearLogButton" onclick="clearLog()">Clear</button></h2>
<p id="log" style="font-family:'Courier New',Courier,monospace"></p>
</body>
<script src="microbit-web-bluetooth-temperature.js"></script>
</html>