-
Notifications
You must be signed in to change notification settings - Fork 0
/
motopi_client.html
73 lines (66 loc) · 1.48 KB
/
motopi_client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<head>
<title>MOTO PI Client Controller</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="HandheldFriendly" content="True" />
<style type="text/css">
input[type="button"]
{
padding: 20px;
border: none;
border-radius: 5px;
background-color: #dd0000;
color: #fff;
font-size: 20px;
font-weight: bold;
margin: 20px;
}
</style>
</head>
<body>
<input type = "button" value="Forward" onmousedown="forward()" onmouseup="stop()">
<input type = "button" value="Backward" onmousedown="backward()" onmouseup="stop()">
<input type = "button" value="Left" onmousedown="left()" onmouseup="stop()">
<input type = "button" value="Right" onmousedown="right()" onmouseup="stop()">
<input type = "button" value="Stop" onmousedown="stop()">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
function forward()
{
$.get("/forward/",{},function(){
console.log("forward");
});
}
function backward()
{
$.get("/backward/",{},function(){
console.log("backward");
});
}
function left()
{
$.get("/left/",{},function(){
console.log("left");
});
}
function right()
{
$.get("/right/",{},function(){
console.log("right");
});
}
function rotateCCW()
{
$.get("/rotateCCW/",{},function(){
console.log("CCW");
});
}
function stop()
{
$.get("/stop/",{},function(){
console.log("stop");
});
}
</script>
</body>
</html>