forked from jjg/RESTduino
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DemoApp.html
43 lines (35 loc) · 1.89 KB
/
DemoApp.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
<html>
<head>
<link type="text/css" href="jquery-ui-1/css/blitzer/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<script type="text/javascript" src="jquery-ui-1/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="jquery-ui-1/js/jquery-ui-1.8.11.custom.min.js"></script>
<meta charset="utf-8">
<script>
$(function() {
$( "#slider-vertical" ).slider({
orientation: "vertical",
range: "min",
min: 0,
max: 255,
value: 100,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value );
// build a URL using the value from the slider
var resturl = "http://192.168.1.177/9/" + ui.value;
// make an AJAX call to the Arduino
$.get(resturl, function(data) {
});
}
});
$( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
});
</script>
</head>
<body>
<p>
<label for="amount">PWM Value:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
</p>
<div id="slider-vertical" style="height:200px;"></div>
</body>
</html>