Skip to content
Newer
Older
100644 44 lines (35 sloc) 1.89 KB
26c933e @jjg Adding a simple jquery-based demo.
authored
1 <html>
2 <head>
3 <link type="text/css" href="jquery-ui-1/css/blitzer/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
4 <script type="text/javascript" src="jquery-ui-1/js/jquery-1.5.1.min.js"></script>
5 <script type="text/javascript" src="jquery-ui-1/js/jquery-ui-1.8.11.custom.min.js"></script>
6 <meta charset="utf-8">
7 <script>
8 $(function() {
9 $( "#slider-vertical" ).slider({
10 orientation: "vertical",
11 range: "min",
12 min: 0,
13 max: 255,
14 value: 100,
15 slide: function( event, ui ) {
16 $( "#amount" ).val( ui.value );
17
18 // build a URL using the value from the slider
19 var resturl = "http://192.168.1.177/9/" + ui.value;
20
21 // make an AJAX call to the Arduino
22 $.get(resturl, function(data) {
23 });
24 }
25 });
26
27 $( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
28
29 });
30 </script>
31 </head>
32 <body>
33
34 <p>
35 <label for="amount">PWM Value:</label>
36 <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
37 </p>
38
39 <div id="slider-vertical" style="height:200px;"></div>
40
41 </body>
42 </html>
43
Something went wrong with that request. Please try again.