diff options
| author | manuel <manuel@mausz.at> | 2013-12-25 13:25:16 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-12-25 13:25:16 +0100 |
| commit | 0c8c9ad976879f7c90f9915a60845ccb0cdb337d (patch) | |
| tree | 162951b4713f3836f4114958a423e2c90ecf9c6b /examples/magpi-9-cambot/index.html | |
| download | webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.tar.gz webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.tar.bz2 webiopi-0c8c9ad976879f7c90f9915a60845ccb0cdb337d.zip | |
initial commit
Diffstat (limited to 'examples/magpi-9-cambot/index.html')
| -rw-r--r-- | examples/magpi-9-cambot/index.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/examples/magpi-9-cambot/index.html b/examples/magpi-9-cambot/index.html new file mode 100644 index 0000000..db69b41 --- /dev/null +++ b/examples/magpi-9-cambot/index.html | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| 5 | <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> | ||
| 6 | <title>CamBot</title> | ||
| 7 | <script type="text/javascript" src="/webiopi.js"></script> | ||
| 8 | <script type="text/javascript"> | ||
| 9 | function init() { | ||
| 10 | var button; | ||
| 11 | |||
| 12 | button = webiopi().createButton("bt_up", "/\\", go_forward, stop); | ||
| 13 | $("#up").append(button); | ||
| 14 | |||
| 15 | button = webiopi().createButton("bt_left", "<", turn_left, stop); | ||
| 16 | $("#middle").append(button); | ||
| 17 | |||
| 18 | button = webiopi().createButton("bt_stop", "X", stop); | ||
| 19 | $("#middle").append(button); | ||
| 20 | |||
| 21 | button = webiopi().createButton("bt_right", ">", turn_right, stop); | ||
| 22 | $("#middle").append(button); | ||
| 23 | |||
| 24 | button = webiopi().createButton("bt_down", "\\/", go_backward, stop); | ||
| 25 | $("#down").append(button); | ||
| 26 | } | ||
| 27 | |||
| 28 | function go_forward() { | ||
| 29 | webiopi().callMacro("go_forward"); | ||
| 30 | } | ||
| 31 | |||
| 32 | function go_backward() { | ||
| 33 | webiopi().callMacro("go_backward"); | ||
| 34 | } | ||
| 35 | |||
| 36 | function turn_right() { | ||
| 37 | webiopi().callMacro("turn_right"); | ||
| 38 | } | ||
| 39 | |||
| 40 | function turn_left() { | ||
| 41 | webiopi().callMacro("turn_left"); | ||
| 42 | } | ||
| 43 | |||
| 44 | function stop() { | ||
| 45 | webiopi().callMacro("stop"); | ||
| 46 | } | ||
| 47 | |||
| 48 | webiopi().ready(init); | ||
| 49 | |||
| 50 | </script> | ||
| 51 | <style type="text/css"> | ||
| 52 | button { | ||
| 53 | margin: 5px 5px 5px 5px; | ||
| 54 | width: 50px; | ||
| 55 | height: 50px; | ||
| 56 | font-size: 24pt; | ||
| 57 | font-weight: bold; | ||
| 58 | color: black; | ||
| 59 | } | ||
| 60 | </style> | ||
| 61 | </head> | ||
| 62 | <body> | ||
| 63 | <div id="content" align="center"> | ||
| 64 | <img width="320" height="240" src="http://raspberrypi:8001/?action=stream"><br/> | ||
| 65 | <div id="up"></div> | ||
| 66 | <div id="middle"></div> | ||
| 67 | <div id="down"></div> | ||
| 68 | </div> | ||
| 69 | </body> | ||
| 70 | </html> | ||
