-
Notifications
You must be signed in to change notification settings - Fork 0
/
LED_bright.html
34 lines (31 loc) · 1.01 KB
/
LED_bright.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>LED bright</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script>
<script src="https://blockly.webduino.io/webduino-blockly.js"></script>
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script>
<style>
#light img {height: 200px; display: none;}
#light.off #light_off, #light.on #light_on {display: inline-block;}
</style>
</head>
<body>
<div id="light" class="off">
<img src="../image/light-off.jpg" id="light_off">
<img src="../image/light-on.jpg" id="light_on">
</div>
<script>
var led;
boardReady({device: 'wa8w'}, board => {
board.systemReset();
board.samplingInterval = 250;
led = getLed(board, 10);
led.on();
document.getElementById("light").className = "on";
});
</script>
</body>