Änderungen

Aus Hackerspace Ffm
Wechseln zu: Navigation, Suche

OmnibotWebcontrol

1.259 Byte hinzugefügt, 21:19, 24. Jul. 2017
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(1600)">Forward</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(2000)">Backward</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(2200)">Left</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(1800)">Right</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(1400)">BeepmodeOn</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(2600)">Test2</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(2400)">Test3</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(2800)">Test4</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(1200)">LeftForward</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(1000)">LeftBackward</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(800)">RightForward</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(4600)">BeepmodeOff</button>
<button onmouseup="myFunctionOff()" onmousedown="myFunctionOn(163)">LowBeep</button>
<input id="slider2" type ="range" min ="50" max="10000" step ="50" value ="100" onchange="myFunctionRange(this.value);"/>
<p id="demo"></p>
<p>A function This is triggered when the button is clicked. The function outputs some text in a p element with id="demo".very basic control for your OMNIBOT!</p>
<script>
function myFunctionOff() {
document.getElementById("demo").innerHTML = "Hello WorldOFF";
gainObj.gain.value = 0;
}
function myFunctionOn(f) {
document.getElementById("demo").innerHTML = "Hello World2ON"; osc.frequency.value = f; setTimeout(10); gainObj.gain.value = 1;
}
function myFunctionRange(f) {
document.getElementById("demo").innerHTML = f;
osc.frequency.value = f;
setTimeout(10);
gainObj.gain.value = 1;
</body>
</html>
 
</pre>
118
Bearbeitungen