Hallo zusammen,
Ich habe nach einen bekannten(?) Buch ein Ferngesteuertes Auto nachgebaut, und ich habe da ein Problem und finde im Internet nicht so recht was ich suche.
Und zwar würde ich gerne per php die Messwerte des Sensehat an das Webinterface schicken wäre das überhaupt möglich ? Habe zwar schon ne Relaischaltung mit php hin bekommen aber das mir die Messwerte insbesondere die Ausrichtung der Himmelsrichtung angezeigt werden leider bis jetzt noch nicht auch nach vielen vielen Fehlversuchen.
Anbei der html code wo es nachher drinne stehen sollen.
Vielen dank schon mal, mir würden auch schon nen Link zum einlesen reichen.
Die pythonscripte sind fertig, die mir die Messwerte im Terminal anzeigen nur da brauch ich sie ja nicht
lg
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="height = 480px, width = 640px user-scalable = yes">
<title>Monte Interface</title>
<script type="text/javascript" src="/webiopi.js"></script>
<script type="text/javascript">
function init() {
}
function Stop() {
webiopi().callMacro("ButtonStop");
}
function Forward() {
webiopi().callMacro("ButtonForward");
}
function Reverse() {
webiopi().callMacro("ButtonReverse");
}
function TurnLeft() {
webiopi().callMacro("ButtonTurnLeft");
}
function TurnRight() {
webiopi().callMacro("ButtonTurnRight");
}
function drive_mode() {
if (document.getElementById)
document.getElementById("forward").style.visibility = "visible";
document.getElementById("backward").style.visibility = "visible";
document.getElementById("left").style.visibility = "visible";
document.getElementById("right").style.visibility = "visible";
document.getElementById("stop").style.visibility = "visible";
document.getElementById("cameramode").style.visibility = "visible";
document.getElementById("cameraleft").style.visibility = "hidden";
document.getElementById("cameraright").style.visibility = "hidden";
document.getElementById("cameraup").style.visibility = "hidden";
document.getElementById("cameradown").style.visibility = "hidden";
document.getElementById("drivemode").style.visibility = "hidden";
}
webiopi().ready(init);
</script>
<style type="text/css">
button.small {
margin: 1px 1px 1px 1px;
width: 24px;
height: 24px;
font-size: 12pt;
font-weight: bold;
color: black;
}
button {
margin: 1px 1px 1px 1px;
width: 90px;
height: 24px;
font-size: 12pt;
font-weight: bold;
color: black;
}
.trPic{
width:640px;
height:480px;
position:absolute;
top:0px;
left:0px;
width:640px;
height:480px;
background: url(http://server2:8080/?action=stream) no-repeat;
border:0px solid #000000;
}
.trPic .forward{
position:absolute;
top:0px;
left:160px;
width:320px;
height:140px;
opacity:0.3;
z-index: 20;
background: url(arrow_forward.png) no-repeat;
background-position: center center;
border:0px solid #000000;
}
.trPic .backward{
position:absolute;
top:340px;
left:160px;
width:320px;
height:140px;
opacity:0.3;
z-index: 20;
background: url(arrow_reverse.png) no-repeat;
background-position: center center;
border:0px solid #000000;
}
.trPic .left{
position:absolute;
top:0px;
left:0px;
width:160px;
height:380px;
opacity:0.3;
z-index: 20;
background: url(arrow_left.png) no-repeat;
background-position: center center;
border:0px solid #000000;
}
.trPic .right{
position:absolute;
top:0px;
left:480px;
width:160px;
height:380px;
opacity:0.3;
z-index: 20;
background: url(arrow_right.png) no-repeat;
background-position: center center;
border:0px solid #000000;
}
.trPic .stop{
position:absolute;
top:140px;
left:160px;
width:320px;
height:200px;
opacity:0.1;
z-index: 20;
background: url(stop.png) no-repeat;
background-position: center center;
border:0px solid #000000;
}
.forward:hover {
opacity:0.7;
}
.backward:hover {
opacity:0.7;
}
.left:hover {
opacity:0.7;
}
.right:hover {
opacity:0.7;
}
.stop:hover {
opacity:0.4;
}
</style>
</head>
<body>
<div class="trPic">
<div id="forward" class="forward" onmousedown="Forward()">
</div>
<div id="backward" class="backward" onmousedown="Reverse()">
</div>
<div id="left" class="left" onmousedown="TurnLeft()">
</div>
<div id="right" class="right" onmousedown="TurnRight()">
</div>
<div id="stop" class="stop" onmousedown="Stop()">
</div>
</div>
</html></body>
<center>
<label><b>Scheinwerfer Steuerung</b></label>
<form>
<button style="height: 30px; width: 120px;" formaction="http://server2/lichtan.php">Licht an</button>
</form>
<form>
<button style="height: 30px; width: 120px;" formaction="http://server2/lichtaus.php">Licht aus</button>
</form>
<br>
<br>
<br>
<br>
Alles anzeigen