Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.09 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.  
  4.     <head>
  5.         <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  6.         <script src="http://10.0.0.13:2424/js/ideino-linino-lib/socket.io.js"></script>
  7.         <script src="http://10.0.0.13:2424/js/ideino-linino-lib/ideino-linino-lib-client.js"></script>
  8.     </head>
  9.     <style>
  10.         .button {
  11.             width: 100px;
  12.             height: 30px;
  13.             border: 1px solid gray;
  14.             box-shadow: 6px 6px 5px #888888;
  15.             position: absolute;
  16.             left: 300px;
  17.             top: 5px;
  18.         }
  19.         .txtbox {
  20.             width: 200px;
  21.             height: 50px;
  22.             border: 1px solid gray;
  23.             font-family: courier;
  24.             font-size: 1.2em;
  25.             text-align:center;
  26.             box-shadow: 6px 6px 5px #888888;
  27.             position: absolute;
  28.         }
  29.         .canvas {
  30.             border: 1px solid gray;
  31.             box-shadow: 6px 6px 5px #888888;
  32.             position: absolute;
  33.         }
  34.     </style>
  35.  
  36.     <body>
  37.         <script>
  38.             window.onload = connect('10.0.0.13');
  39.  
  40.             function aread() {
  41.                 analogRead('A0', function(myData) {
  42.                     document.getElementById("myCanvas1").height = myData.value;
  43.                     document.getElementById('txtValue1').value = myData.value;
  44.                     if (myData.value > 300) {
  45.                         var c = document.getElementById("myCanvas1");
  46.                         var ctx = c.getContext("2d");
  47.                         ctx.fillStyle = "#FF0000";
  48.                         ctx.fillRect(0, 0, 200, myData.value);
  49.                     }
  50.                 });
  51.  
  52.                 analogRead('A1', function(myData) {
  53.                     document.getElementById("myCanvas2").height = myData.value;
  54.                     document.getElementById('txtValue2').value = myData.value;
  55.                     if (myData.value > 400) {
  56.                         var c = document.getElementById("myCanvas2");
  57.                         var ctx = c.getContext("2d");
  58.                         ctx.fillStyle = "#FF0000";
  59.                         ctx.fillRect(0, 0, 200, myData.value);
  60.                         alarm.play();
  61.                     }
  62.                 });
  63.             }
  64.         </script>
  65.         <div>
  66.             <audio id="alarm">
  67.                 <source src="Alarm.mp3" type="audio/mp3">Your browser does not support HTML5 video.</audio>
  68.             <br/>
  69.             <button type="button" class="button" onclick="aread()">Start</button>
  70.             <br/>
  71.             <canvas id="myCanvas1" class="canvas" width="200" style="left: 100px;bottom: 50px;"></canvas>
  72.             <input type="label" id="txtValue1" class="txtbox" placeholder="Baby's movements" style="left: 100px;top: 60px;">
  73.             <canvas id="myCanvas2" class="canvas" width="200" style="left: 400px;bottom: 50px;"></canvas>
  74.             <input type="label" id="txtValue2" class="txtbox" placeholder="Baby's audio" style="left: 400px;top: 60px;">
  75.         </div>
  76.     </body>
  77.  
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement