|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MJPEG-Streamer</title>
</head>
<script type="text/javascript">
var imageNr = 0; // Serial number of current image
var finished = new Array(); // References to img objects which have finished downloading
var paused = false;
function sendSer(value)
{
document.getElementById("ser").src="/www/cgi-bin/wificar?"+value;
}
function createImageLayer() {
var img = new Image();
img.style.position = "absolute";
img.style.zIndex = -1;
img.onload = imageOnload;
img.onclick = imageOnclick;
img.src = "/?action=snapshot&n=" + (++imageNr);
var webcam = document.getElementById("webcam");
webcam.insertBefore(img, webcam.firstChild);
}
// Two layers are always present (except at the very beginning), to avoid flicker
function imageOnload() {
this.style.zIndex = imageNr; // Image finished, bring to front!
while (1 < finished.length) {
var del = finished.shift(); // Delete old image(s) from document
del.parentNode.removeChild(del);
}
finished.push(this);
if (!paused) createImageLayer();
}
function imageOnclick() { // Clicking on the image will pause the stream
paused = !paused;
if (!paused) createImageLayer();
}
</script>
<div style="float:left">
<table>
<tr><img id="ser" width="1" height="1"></tr>
<tr><td colspan="3" align="middle">
<input type="button" style="height:100px; width:100px" value="U"/></td>
</tr>
<tr>
<td><input type="button" style="height:100px; width:100px" value="L" /></td>
<td><input type="button" style="height:100px; width:100px" value="R" /></td>
</tr>
<tr><td colspan="3" align="middle">
<input type="button" style="height:100px;width:100px;" value="T"/></td>
</tr>
<tr><td colspan="3" align="middle">
<input type="button" style="height:100px;width:100px;" value="D"/></td>
</tr>
</table>
</div>
<div style="float:left">
<body>
<div id="webcam"><noscript><img src="/?action=snapshot" /></noscript></div>
</body>
</div>
</html>
wificar的程序是
#!/usr/bin/lua
io.output("/dev/tttyATH0")
io.write("os.getenv("QUERY_STRING")")
这是哪错了?串口没信号输出。点击按钮的时候,感觉onclick事件没有触发。。。卡这了。。
|
|