<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hack Pittsburgh &#187; presence</title>
	<atom:link href="http://www.hackpittsburgh.org/tag/presence/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hackpittsburgh.org</link>
	<description>Hackers, makers, movers &#38; shakers.</description>
	<lastBuildDate>Thu, 29 Jul 2010 01:34:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ioBridge tells us when someone&#8217;s at HackPGH</title>
		<link>http://www.hackpittsburgh.org/iobridge-tells-us-when-someones-at-hackpgh</link>
		<comments>http://www.hackpittsburgh.org/iobridge-tells-us-when-someones-at-hackpgh#comments</comments>
		<pubDate>Thu, 19 Nov 2009 17:54:21 +0000</pubDate>
		<dc:creator>schmarty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haxx]]></category>
		<category><![CDATA[iobridge]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[presence]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hackpittsburgh.org/?p=500</guid>
		<description><![CDATA[Last Friday, HackPittsburgh was lucky enough to get an in-person presentation and demo of the ioBridge, a fantastic way to wire up your electronics projects to the web.  On top of that, the ioBridge team was nice enough to donate one of their awesome IO-204 control modules, and a handful of expansion modules!
Members Andy Leer [...]]]></description>
			<content:encoded><![CDATA[<p>Last Friday, HackPittsburgh was lucky enough to get an in-person presentation and <a href="http://www.hackpittsburgh.org/?p=405">demo of the ioBridge</a>, a fantastic way to wire up your electronics projects to the web.  On top of that, the ioBridge team was nice enough to donate one of their awesome <a href="http://iobridge.com/">IO-204 control modules</a>, and a handful of expansion modules!</p>
<p>Members Andy Leer and Marty McGuire thought that a nice first project for our ioBridge would be a shop presence notification system.  The idea is simple: the ioBridge senses the ambient light in the shop.  A web-widget reads this data from the ioBridge service, and displays an open sign if the light level is above a certain threshold, or a closed sign in the light level is below threshold. If the module is offline, we should not display the widget at all.</p>
<h2>Step 1 &#8211; Prepare the ioBridge</h2>
<p><a href="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/iobridge_with_light_sensor.jpg"><img class="alignnone size-medium wp-image-518" title="iobridge_with_light_sensor" src="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/iobridge_with_light_sensor-300x225.jpg" alt="iobridge_with_light_sensor" width="300" height="225" /></a></p>
<p>Set up your ioBridge with the ambient light sensor module on channel 1 and connect it to the internet.  Next, register your module as <a href="http://www.iobridge.net/wiki/interface">described on the ioBridge Interface page</a>.</p>
<h2>Step 2 &#8211; Get your module&#8217;s Feed ID</h2>
<p>On the Modules page, copy your Feed URL by right-clicking on the link shown below and copying it to the clipboard.</p>
<p><a href="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/iobridge_module_feed_url.png"><img class="alignnone size-full wp-image-501" style="border: 1px solid black;" title="iobridge_module_feed_url" src="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/iobridge_module_feed_url.png" alt="iobridge_module_feed_url" width="593" height="158" /></a></p>
<p>This URL gives you a JSON snapshot of the state of your module, including its ID, Online/Offline status, and the status of the lines on each channel. Now, we need to do something with this data!</p>
<h2>Step 3 &#8211; Feed your module data to jQuery</h2>
<p><a href="http://jquery.com/">jQuery</a> is an excellent JavaScript foundation library for making AJAX techniques easy.  In this case, we&#8217;ll be using jQuery to periodically load the JSON-formatted data from the ioBridge and update parts of the web page accordingly.  Below is the code for a simple test page that will display the Online/Offline status of the module, and whether the ambient light is over 500 (on a scale of 0&#8211;1023):</p>
<p><script src="http://gist.github.com/238905.js"></script></p>
<h2>Step 4 &#8211; Pretty It Up</h2>
<p>The last part of this project involved creating a couple of images to indicate lights-on/lights-off and some changes in the code to show the appropriate image only if the ioBridge appears to be Online.  Here are the images that Andy created:  <a href="http://www.hackpittsburgh.org/wp-content/themes/azul/images/shopOpen.png"><img class="alignnone" style="border: 0pt none;" title="shop open image" src="http://www.hackpittsburgh.org/wp-content/themes/azul/images/shopOpen.png" alt="" width="209" height="88" /></a> <a href="http://www.hackpittsburgh.org/wp-content/themes/azul/images/shopClosed.png"><img class="alignnone" style="border: 0pt none;" title="shop closed image" src="http://www.hackpittsburgh.org/wp-content/themes/azul/images/shopClosed.png" alt="" width="209" height="88" /></a></p>
<p>Because we use Wordpress to host this blog, it was a pretty simple matter to add jQuery to the main template, and create a plain HTML widget that includes all of the correct code:  </p>
<p><script src="http://gist.github.com/238922.js?file=hackpgh_light_widget.html"></script></p>
<p>This is what it looks like at time of writing, with the ioBridge online and the shop lights off:</p>
<p><a href="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/shop_status_closed.png"><img class="alignnone size-full wp-image-519" title="shop_status_closed" src="http://www.hackpittsburgh.org/wp-content/uploads/2009/11/shop_status_closed.png" alt="shop_status_closed" width="325" height="218" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackpittsburgh.org/iobridge-tells-us-when-someones-at-hackpgh/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
