diff service/garageArduino/index.html @ 0:6fd208b97616

start Ignore-this: e06ac598970a0d4750f588ab89f56996
author Drew Perttula <drewp@bigasterisk.com>
date Mon, 01 Aug 2011 03:30:30 -0700
parents
children be855a111619
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/service/garageArduino/index.html	Mon Aug 01 03:30:30 2011 -0700
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>garageArduino</title>
+    <link rel="alternate" type="application/x-trig" title="RDF graph" href="graph" />
+    <style type="text/css" media="all">
+      /* <![CDATA[ */
+.val {
+font-weight: bold;
+} 
+/* ]]> */
+    </style>
+
+  </head>
+  <body>
+
+    <h1>garageArduino service</h1>
+
+    <p>Talking to an arduino uno on host <tt>slash</tt></p>
+
+    <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>
+
+    <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>
+
+    <p><button type="submit" id="refresh">refresh</button></p>
+
+    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"/>
+    <script type="text/javascript">
+     // <![CDATA[
+    $(function () {
+	function setTexts(data) {
+	  $.each(data, function (k,v) { $("#"+k).text(v); })
+	}
+	function refresh() {
+	    $.getJSON("frontDoorMotion", setTexts);
+	    $.getJSON("housePower", setTexts);
+	}
+	refresh();
+	$("#refresh").click(refresh);
+    });
+     // ]]>
+    </script>
+  </body>
+</html>
\ No newline at end of file