annotate service/garageArduino/index.html @ 5:4c44c80a6a72

move garage door opener from parport to arduino Ignore-this: c7d21f40841af0e64b26dd4991e441ae
author drewp@bigasterisk.com
date Sun, 14 Aug 2011 21:46:57 -0700
parents be855a111619
children 90ff65ccd46b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
1 <?xml version="1.0" encoding="iso-8859-1"?>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml">
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
5 <head>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
6 <title>garageArduino</title>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
7 <link rel="alternate" type="application/x-trig" title="RDF graph" href="graph" />
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
8 <style type="text/css" media="all">
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
9 /* <![CDATA[ */
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
10 .val {
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
11 font-weight: bold;
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
12 }
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
13 /* ]]> */
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
14 </style>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
15 </head>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
16 <body>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
17
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
18 <h1>garageArduino service</h1>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
19
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
20 <p>Talking to an arduino uno on host <tt>slash</tt></p>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
21
5
4c44c80a6a72 move garage door opener from parport to arduino
drewp@bigasterisk.com
parents: 4
diff changeset
22 <p>Pulse pin 3 to trigger garage door opener <form method="post" action="garageDoorOpen"><input type="submit" value="Garage door opener"/></form></p>
4c44c80a6a72 move garage door opener from parport to arduino
drewp@bigasterisk.com
parents: 4
diff changeset
23
0
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
24 <p><a href="http://octopart.com/555-28027-parallax-708653">PIR sensor</a> (in <a href="http://octopart.com/1551ggy-hammond-15686">a box</a>) measuring front door motion: <span class="val" id="frontDoorMotion"/></p>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
25
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
26 <p><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;productId=2006414&amp;catalogId=10001&amp;freeText=2006414&amp;app.products.maxperpage=15&amp;storeId=10001&amp;search_type=jamecoall&amp;ddkey=http:StoreCatalogDrillDownView">phototransistor</a> watching IR pulses on the power meter: last pulse was <span class="val" id="lastPulseAgo"/>; current power usage is <span class="val"><span id="currentWatts"/> watts</span> (assuming <span class="val" id="kwhPerBlink"/> kwh/blink)</p>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
27
4
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
28 <p>Recent raw IR sensor data: <div><img src="" id="raw"/></div></p>
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
29
0
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
30 <p><button type="submit" id="refresh">refresh</button></p>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
31
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
32 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"/>
4
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
33
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
34
0
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
35 <script type="text/javascript">
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
36 // <![CDATA[
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
37 $(function () {
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
38 function setTexts(data) {
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
39 $.each(data, function (k,v) { $("#"+k).text(v); })
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
40 }
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
41 function refresh() {
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
42 $.getJSON("frontDoorMotion", setTexts);
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
43 $.getJSON("housePower", setTexts);
4
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
44
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
45 $.getJSON("housePower/raw", function (data) {
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
46 var xp=[], yp=[];
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
47 var start = data.irLevels[0][0];
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
48 var maxTime = 0;
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
49 $.each(data.irLevels, function (i, xy) {
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
50 maxTime = xy[0] - start;
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
51 xp.push(maxTime.toPrecision(3));
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
52 yp.push(xy[1]);
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
53 });
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
54 // edit with http://imagecharteditor.appspot.com/
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
55 $("#raw").attr("src",
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
56 "http://chart.apis.google.com/chart"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
57 "?chxr=0,0,"+maxTime+"|1,0,1024"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
58 "&chds=0,"+maxTime+",0,1024"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
59 "&chxl=2:|seconds"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
60 "&chxs=0,676767,11.5,0,lt,676767|1,676767,11.5,-0.5,l,676767"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
61 "&chxt=x,y,x"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
62 "&chs=600x200"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
63 "&cht=lxy"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
64 "&chco=76A4FB"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
65 "&chd=t:"+xp.join(",")+"|"+yp.join(",")+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
66 "&chg=10,20"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
67 "&chls=2"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
68 "&chma=40,20,20,30"+
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
69 "&chm=h,FF0000,0,0.7:50:2,1");
be855a111619 move a bunch of services into this tree, give them all web status pages
drewp@bigasterisk.com
parents: 0
diff changeset
70 });
0
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
71 }
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
72 refresh();
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
73 $("#refresh").click(refresh);
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
74 });
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
75 // ]]>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
76 </script>
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
77 </body>
5
4c44c80a6a72 move garage door opener from parport to arduino
drewp@bigasterisk.com
parents: 4
diff changeset
78 </html>