-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprimer05.html
42 lines (30 loc) · 926 Bytes
/
primer05.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
<!DOCTYPE html>
<meta charset = utf8>
<html>
<head>
<title>Primer z gumbi</title>
</head>
<body>
<button id="gumbPrižgi1" onClick="prižgi1()">Prižgi Z</button>
<button id="gumbUgasni1" onClick="ugasni1()">Ugasni Z</button>
<button id="gumbPrižgi2" onClick="prižgi2()">Prižgi O</button>
<button id="gumbUgasni2" onClick="ugasni2()">Ugasni O</button>
<br>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
var socket = io.connect("192.168.1.106:8080"); // povez. prek vtičnika
function prižgi1 () {
socket.emit("ukazArduinu", 1); // na strežnik pošljem 1
}
function ugasni1 () {
socket.emit("ukazArduinu", 0); // na strežnik pošljem 0
}
function prižgi2 () {
socket.emit("ukazArduinu", 3); // na strežnik pošljem 1
}
function ugasni2 () {
socket.emit("ukazArduinu", 2); // na strežnik pošljem 0
}
</script>
</body>
</html>