OSDN Git Service

alpha 1 development in progress.
[dennco/dennco.git] / Samples / Samples / Sample3_Arduino1 / ui / index.html
diff --git a/Samples/Samples/Sample3_Arduino1/ui/index.html b/Samples/Samples/Sample3_Arduino1/ui/index.html
new file mode 100644 (file)
index 0000000..332697a
--- /dev/null
@@ -0,0 +1,43 @@
+<html>
+<head>
+<title>Dennco Sample3 - work with Arduino</title>
+<script type="text/javascript">
+var timerId = setInterval("updateOutput()", 100);
+
+function updateOutput()
+{
+       document.getElementById("analog1Value").value = engine.getValue('/cells.xhtml#ui_out1');
+}
+
+function updateInput1(newValue)
+{
+       engine.setValue('/cells.xhtml#ui_in1', newValue);
+       document.getElementById("input1Value").value = newValue;
+}
+
+function stopTimer()
+{
+       clearInterval(timerId);
+}
+</script>
+</head>
+<body onunload="stopTimer()">
+<h3>Sample3 - work with Arduino</h3>
+<table border=1 cellspacing=0 cellpadding=2>
+<tr>
+<td>Control PWD3</td>
+<td>
+<input type="range"  min="0" max="255" value="0" onChange="updateInput1(this.value)" />
+<input type="text" value="0" disabled size="4" style="text-align:right" id="input1Value"/>
+</td>
+</tr>
+<tr>
+<td>Input from Arduino Analog1</td>
+<td>
+<input type="text" value="0" disabled  size="4" style="text-align:right" id="analog1Value"/>
+</td>
+</tr>
+</table>
+
+</body>
+</html>