0
|
1 <?xml version="1.0" encoding="iso-8859-1"?>
|
|
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
|
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
4 <html xmlns="http://www.w3.org/1999/xhtml">
|
|
5 <head>
|
|
6 <title>garageArduino</title>
|
|
7 <link rel="alternate" type="application/x-trig" title="RDF graph" href="graph" />
|
|
8 <style type="text/css" media="all">
|
|
9 /* <![CDATA[ */
|
|
10 .val {
|
|
11 font-weight: bold;
|
|
12 }
|
|
13 /* ]]> */
|
|
14 </style>
|
|
15
|
|
16 </head>
|
|
17 <body>
|
|
18
|
|
19 <h1>garageArduino service</h1>
|
|
20
|
|
21 <p>Talking to an arduino uno on host <tt>slash</tt></p>
|
|
22
|
|
23 <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>
|
|
24
|
|
25 <p><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&productId=2006414&catalogId=10001&freeText=2006414&app.products.maxperpage=15&storeId=10001&search_type=jamecoall&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>
|
|
26
|
|
27 <p><button type="submit" id="refresh">refresh</button></p>
|
|
28
|
|
29 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"/>
|
|
30 <script type="text/javascript">
|
|
31 // <![CDATA[
|
|
32 $(function () {
|
|
33 function setTexts(data) {
|
|
34 $.each(data, function (k,v) { $("#"+k).text(v); })
|
|
35 }
|
|
36 function refresh() {
|
|
37 $.getJSON("frontDoorMotion", setTexts);
|
|
38 $.getJSON("housePower", setTexts);
|
|
39 }
|
|
40 refresh();
|
|
41 $("#refresh").click(refresh);
|
|
42 });
|
|
43 // ]]>
|
|
44 </script>
|
|
45 </body>
|
|
46 </html> |