<?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>eclecticc</title>
	<atom:link href="http://eclecti.cc/feed" rel="self" type="application/rss+xml" />
	<link>http://eclecti.cc</link>
	<description></description>
	<lastBuildDate>Mon, 09 Aug 2010 07:26:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Normal people don&#8217;t have these problems</title>
		<link>http://eclecti.cc/hardware/normal-people-dont-have-these-problems</link>
		<comments>http://eclecti.cc/hardware/normal-people-dont-have-these-problems#comments</comments>
		<pubDate>Mon, 09 Aug 2010 07:26:52 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[camry]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=585</guid>
		<description><![CDATA[I drive the least interesting car in the world, a gray 2004 Toyota Camry.  To stave off death from boredom while driving, I use a tape adapter connected to an A2DP receiver to wirelessly listen to music from my iPhone.  A few weeks ago, the tape deck developed an extremely irritating clicking noise.  The easy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/08/aux.jpg"><img class="aligncenter size-large wp-image-584" title="Better than a tape deck anyway." src="http://eclecti.cc/files/2010/08/aux-700x466.jpg" alt="Auxilliary Input" width="700" height="466" /></a></p>
<p>I drive the least interesting car in the world, a gray 2004 Toyota Camry.  To stave off death from boredom while driving, I use a tape adapter connected to an A2DP receiver to wirelessly listen to music from my iPhone.  A few weeks ago, the tape deck developed an extremely irritating clicking noise.  The easy options, the ones that most Camry owners would choose, would be to turn on the radio, get an FM transmitter for the iPhone, listen to CDs, or just let the tape deck click.  Being an engineer, I refuse pick the easy option, but rather the one that seems best, which inevitably devolves into a weekend of hacking, cursing, and setting things on fire, with a best case of eventually restoring the object of interest to something resembling a functioning state.</p>
<p>The plan was to enable direct auxiliary input, which the Internet  claimed was possible on this model.  The backup plan was to resolve the  clicking noise by just unplugging the tape motor, which we assumed was  unnecessary to operate the adapter.  My roommate Will and I popped the head unit out of the car with much effort and two trips to the hardware store.  Apparently stealing a radio isn&#8217;t easy, even from your own car.</p>
<p>Attempting to power the unit off of the 12v rail of a 350w ATX power supply resulted in it shutting off immediately.  With a 450w PSU connected to the battery and accessory voltage lines, a tiny laptop speaker from my spare parts bin connected to the massive amp, and another speaker being used as an antenna, we managed to pull in the beautiful sound of late 70&#8242;s hits on FM radio.</p>
<p>I&#8217;m not entirely sure what happened, but Will managed to break the tape deck in about a dozen different ways over the course of the next couple of hours.  It wouldn&#8217;t play at all without the drive gears spinning, it refused to eject tapes because it believed it was empty, and still, the clicking gear clicked.</p>
<p>It was then up to me to get aux in working.  Apparently, Toyotas from around my model year use AVC-Lan, a communications bus based on IEBus for the head unit to connect to things like a CD changer.  There is some pretty <a href="http://www.softservice.com.pl/corolla/avc/avclan.php">solid research</a> across the web on how to emulate a device on the bus to message the head unit to use its aux input.  I used the circuit and software from <a href="http://www.sigmaobjects.com/toyota/">SigmaObjects</a>, as it required only parts I already had or could get from Halted.  The code there is designed for an ATmega8, but with some trial and error, I managed to port it to the current ATmega48/88/168 series.  Unfortunately, the code doesn&#8217;t mention being under any permissive license, so I can&#8217;t share my modifications.</p>
<p>While hooking it up to the head unit, the wire connecting the device to ground actually burst into flames, burning part of a connector and melting copper.  On later inspection, we found that the wires were extremely high gauge internally, and it is likely that only a single thin strand was carrying the current in the area that caught fire.  Miraculously, neither the radio nor the ATmega168 was damaged by the incident.  I switched to lower gauge higher quality wire, checked my car insurance terms relating to explosion due to user error, and continued.</p>
<p><a href="http://eclecti.cc/files/2010/08/burnt.jpg"><img class="aligncenter size-large wp-image-588" title="It smelled much worse than it looks." src="http://eclecti.cc/files/2010/08/burnt-700x466.jpg" alt="Burnt Wire" width="700" height="466" /></a></p>
<p>After a few more hours of debugging, I realized that I had the two data lines backwards, and after switching them it worked instantly.  We repurposed the TAPE button to switch to aux in.  I taped the board down, put the head unit back together, and we stuck it back into the car.  There was an unnerving startup delay the first few times, but I am now the proud owner of a gray 2004 Toyota Camry with auxiliary audio input&#8230; and no tape deck.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/normal-people-dont-have-these-problems/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using the TI MSP430 LaunchPad with Ubuntu 10.04</title>
		<link>http://eclecti.cc/hardware/using-the-ti-msp430-launchpad-with-ubuntu-10-04</link>
		<comments>http://eclecti.cc/hardware/using-the-ti-msp430-launchpad-with-ubuntu-10-04#comments</comments>
		<pubDate>Sun, 04 Jul 2010 01:25:24 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[msp430]]></category>
		<category><![CDATA[ti]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=568</guid>
		<description><![CDATA[The Arduino and the massive community around it have made AVR the de facto standard for hobby microcontrollers, despite the aloofness of Atmel to take advantage of it.  TI apparently decided that they wanted a piece of the pie, so they took a peek at the Arduino recipe and are now selling something that looks [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/07/launchpad.jpg"><img class="aligncenter size-large wp-image-569" title="TI is hoping that if you squint hard enough, you'll mistake it for an Arduino." src="http://eclecti.cc/files/2010/07/launchpad-700x466.jpg" alt="TI MSP430 LaunchPad" width="700" height="466" /></a></p>
<p>The <a href="http://arduino.cc/">Arduino</a> and the massive community around it have made AVR the de facto standard for hobby microcontrollers, despite the aloofness of Atmel to take advantage of it.  TI apparently decided that they wanted a piece of the pie, so they took a peek at the Arduino recipe and are now selling something that looks a whole lot like it for a fraction of the price.  The <a href="http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29">TI MSP430 LaunchPad</a> ships with a MSP430G2231 and a MSP430G2211,  microcontrollers sourced from TI&#8217;s Value Line.  The first, with I²C, SPI, ADCs, PWM, and UART, is a capable Arduino replacement for physical computing, though the latter chip is limited mostly to GPIO.  Unfortunately, both are a bit anemic when it comes to Flash and RAM.  TI&#8217;s <a href="http://www.ti.com/ww/en/mcu/valueline/index.shtml">roadmap</a> shows promise regarding this issue.</p>
<p>The big problem though, is software.  The appeal of Arduino is largely that it has a dead simple to use, cross platform IDE, running on the well maintained and supported avrgcc and avrdude.  TI&#8217;s solution, on the other hand, is a set of two Windows-only, registration-required, code-limited, IDEs.  Linux and Mac users are left a little high and dry.  Luckily, there are some projects, new and old, that make it work out.</p>
<p>You can follow the instructions at <a href="http://mylightswitch.com/2010/06/21/installing-mpsgcc4-and-mspdebug-on-kubuntu-1004/">mylightswitch</a> to install <a href="http://mspgcc4.sourceforge.net/">MSPGCC4</a> and <a href="http://mspdebug.sourceforge.net/">mspdebug</a>, neither of which is in the Lucid repositories.  MSPGCC is an MSP430 port of the GCC toolchain, complete with GDB.  mspdebug lets you program and erase the flash on the LaunchPad, among many other things.  There are some usage instructions for it at <a href="http://losinggeneration.homelinux.org/2010/07/02/msp430-launchpad-on-linux/">Ramblings and Broken Code</a>.  True to its name, the guide is partially broken.  To use the LaunchPad with mspdebug 0.9, you have to specify the driver instead of using -R.  In our case, we want to use the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mspdebug rf2500</pre></div></div>

<p>Ideally, we would be able to use the uif driver that the <a href="http://focus.ti.com/docs/toolsw/folders/print/ez430-f2013.html">eZ430U</a> and other TI development boards use.  Unfortunately, the LaunchPad is incompatible with the firmware used with the ti_usb_3410_5052 module that comes with Linux.  There is a really amazing three part series on this at <a href="http://travisgoodspeed.blogspot.com/2008/05/repurposing-ti-ez430u-part-1.html">Travis Goodspeed&#8217;s blog</a>.</p>
<p>While it is indeed possible to use the LaunchPad and MSP430 devices in general in Linux, I&#8217;m going to stick with the trusty AVR/Arduino combo for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/using-the-ti-msp430-launchpad-with-ubuntu-10-04/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Projecting Virtual Reality with a Microvision SHOWWX</title>
		<link>http://eclecti.cc/videogames/projecting-virtual-reality-with-a-microvision-showwx</link>
		<comments>http://eclecti.cc/videogames/projecting-virtual-reality-with-a-microvision-showwx#comments</comments>
		<pubDate>Sun, 09 May 2010 09:27:25 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Video Games]]></category>
		<category><![CDATA[microvision]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[showwx]]></category>
		<category><![CDATA[spacepoint fusion]]></category>
		<category><![CDATA[virtual reality]]></category>
		<category><![CDATA[wiimote]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=551</guid>
		<description><![CDATA[www.youtube.com/watch?v=OvfT3TX_tn0 It&#8217;s bit of a stretch to call this Virtual Reality, in capitals no less, but I can&#8217;t think of another noun that fits it better.  This is the idea I have been hinting about, sprouted into a proof of concept.  By combining the stable positioning of the SpacePoint Fusion with the always in focus [...]]]></description>
			<content:encoded><![CDATA[<p><span class="youtube">
<object width="700" height="420">
<param name="movie" value="http://www.youtube.com/v/OvfT3TX_tn0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showsearch=0?rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/OvfT3TX_tn0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showsearch=0?rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="700" height="420"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=OvfT3TX_tn0">www.youtube.com/watch?v=OvfT3TX_tn0</a></p></p>
<p>It&#8217;s bit of a stretch to call this Virtual Reality, in capitals no less, but I can&#8217;t think of another noun that fits it better.  This is the idea I have been hinting about, sprouted into a proof of concept.  By combining the stable positioning of the <a href="http://eclecti.cc/hardware/easy-absolute-orientation-pni-spacepoint-fusion-in-python">SpacePoint Fusion</a> with the always in focus <a href="http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball">Microvision SHOWWX</a> picoprojector, one can create a pretty convincing glasses-free virtual reality setup in any smallish dark room, like the bedroom in my Bay Area apartment.</p>
<p><a href="http://eclecti.cc/files/2010/05/projecting.jpg"><img src="http://eclecti.cc/files/2010/05/projecting-700x466.jpg" alt="Projecting Virtual Reality" title="Unfortunately shallow depth of field.  I couldn&#039;t hold the thing still enough to use a saner f-stop while getting a long enough exposure to see the projected image." width="700" height="466" class="aligncenter size-large wp-image-566" /></a></p>
<p>This setup uses the SpacePoint to control the yaw, pitch, and roll of the camera, letting you look and aim around the virtual environment that is projected around you.  A Wii Remote and Nunchuk provide a joystick for movement and buttons for firing, jumping, and switching weapons.  All of the items are mounted to a Wii Zapper.  For now, it is annoyingly all wired to a laptop I carried around in a backpack.  Eventually, I&#8217;m planning on using a <a href="http://beagleboard.org">BeagleBoard</a> and making the whole projector/computer/controller/gun setup self-contained.</p>
<p>The software is a hacked version of <a href="http://cubeengine.com/cube.php4">Cube</a>, a lightweight open source first person shooter.  It&#8217;s no Crysis 2, but it runs well on Mesa on integrated graphics, and it&#8217;s a lot easier to modify for this purpose than Quake 3.  Input is via <a href="http://libhid.alioth.debian.org/">libhid</a> for the SpacePoint and <a href="http://abstrakraft.org/cwiid/">CWiid</a> for the Wiimote.  All in all, it actually works pretty well.  The narrow field of view and immersiveness (a word, despite what my dictionary claims) makes playing an FPS quite a bit scarier for those who are easily spooked, like yours truly.  There is some serious potential in the horror/zombie/velociraptor genres for a device like this, if anyone is interested in designing a game.</p>
<p>This is just the start, of course.  I know I say that a lot, and there are about a dozen projects on this blog I&#8217;ve abandoned, but I think this one will hold my attention for a while.  I hate showing off anything without source code, so even though it will likely not be useful to anyone, I&#8217;ve attached the patch against the <a href="http://sourceforge.net/projects/cube/files/cube/2005_08_29/cube_2005_08_29_src.zip/download">final release of Cube</a>.</p>
<p><strong>Download:<br />
<a href="http://eclecti.cc/files/2010/05/projecting.diff">projecting.diff</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/videogames/projecting-virtual-reality-with-a-microvision-showwx/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>A Pragmatic Workaround for Perpetual Copyright</title>
		<link>http://eclecti.cc/bytes/a-pragmatic-workaround-for-perpetual-copyright</link>
		<comments>http://eclecti.cc/bytes/a-pragmatic-workaround-for-perpetual-copyright#comments</comments>
		<pubDate>Sun, 25 Apr 2010 08:25:44 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Bytes]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[intellectual property]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=511</guid>
		<description><![CDATA[To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries. Article I, Section 8, Clause 8, United States Constitution One of the few Congressional powers specifically enumerated in the Constitution over two hundred years ago allows for the [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
<p style="text-align: left;"><em>To promote the Progress of Science and useful Arts, by securing for  limited Times to Authors and Inventors the exclusive Right to their  respective Writings and Discoveries.</em></p>
<p style="text-align: right;">Article I, Section 8, Clause 8, United States Constitution</p>
</blockquote>
<p>One of the few Congressional powers specifically enumerated in the Constitution over two hundred years ago allows for the protection of intellectual property rights for a limited period of time.  Limited is, like much of the Constitution, intentionally vague.  In theory, depending on the whims of the judiciary in place, limited could be defined as anything up to the heat death of the universe.  <a href="http://supct.law.cornell.edu/supct/html/01-618.ZS.html">Recent judgments</a> put this within the realm of possibility.  I will not use this space as a discussion (rant) about copyright law or  reform, mostly because there are <a href="http://www.michaelgeist.ca/">much better</a> and <a href="http://www.lessig.org/blog/">more interesting</a> places to  read about that.  I will, however, describe my experiences as a user of copyright and propose a workaround for some of its woes.</p>
<p>The <a href="http://en.wikipedia.org/wiki/1976_Copyright_Act">Copyright Act of 1976</a>, as confirmed in <a href="http://cyberlaw.stanford.edu/node/5110"><em>Kahle v. Gonzales</em></a>, changed copyright from an opt-in system requiring registration to an opt-out system, in which any copyrightable work is automatically copyrighted upon publishing.  That means that without any intervention on my part, under current copyright law and assuming no further extensions, this blog post will enter the public domain April 25th, 2080 if I croak immediately after hitting the Publish button.  As my red meat intake has been limited recently and Congress is still in the pocket of big business, I expect the actual date will be much later.</p>
<p>Many rightly find this unreasonable, hence the rise of the copyleft and free culture movements.  Practically perpetual copyright isn&#8217;t so bad when the work is opened by a permissive license like <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution</a> or three clause <a href="http://www.opensource.org/licenses/bsd-license.php">BSD</a> or a reciprocal license like the <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.  Or is it?  If in 2134, a brain hacking hobbyist decides she wants to repurpose and distribute a <a href="http://eclecti.cc/videogames/rocketpong-a-zero-button-voice-activated-game">Python game</a> I wrote in 2009 as a retro eyesaver, should she really have to include the <a href="http://www.isc.org/software/license">ISC license</a> stating that my corpse disclaims all warranties including implied warranties of merchantability and fitness?  I argue that in a sane society, she should not, as the work would long have been in the public domain.  However, the license I attached to the work will remain valid for the entire absurd length of its copyright.</p>
<p>I propose a simple workaround for this problem: a self-destruct wrapper for licenses.  That is, a legal instrument by which the owner of a work can specify that he or she voluntarily and automatically relinquishes the work into the public domain after a specific number of years.  This is à la carte copyright, in which the creator may choose a length that seems sane, like the 14 years we started with in 1790.  This also has the effect of trumping any further extensions Congress may enact to keep <a href="http://en.wikipedia.org/wiki/Steamboat_Willie">Steamboat Willie</a> in the vault, preventing a work I publish today from remaining under copyright in 3010.  One could use such a wrapper on any license, permissive, reciprocal, or restrictive.  An individual or company could profit from a work for a period of time of their choosing, and automatically grant it to the betterment of society at the self destruct date of the license.  A software developer can protect a piece of code from going proprietary with the GPL today without forever limiting projects that use it to a copyleft license.  I could protect myself from exploitation by marking a photograph I&#8217;ve taken as <a href="http://creativecommons.org/about/licenses">CC by-nc-nd</a> for now without preventing its public use long after my death.</p>
<p>I can&#8217;t even pretend to be a lawyer, but here&#8217;s a proof of concept ripped from a piece of the <a href="http://creativecommons.org/publicdomain/zero/1.0/">Creative Commons Zero</a> license.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
Upon the date of publication, the License shall be deemed effective.  Upon
X years from the date of publication, the Waiver shall be deemed effective.
&nbsp;
Waiver:
To the greatest extent permitted by, but not in contravention of, applicable
law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the &quot;Waiver&quot;). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
&nbsp;
License:
...
*/</span></pre></div></div>

<p>Since I am not a lawyer, I have no idea if a self-destructing license is legally possible.  I would like to get lawyerly advice on the idea before I start attaching it to my projects, but this is certainly something I plan on using.  Hopefully it appeals to others too.  Since the bug fix for perpetual copyright isn&#8217;t coming any time soon, this workaround will have to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/bytes/a-pragmatic-workaround-for-perpetual-copyright/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evil Eye: Microvision SHOWWX as a Face Tracking Eyeball</title>
		<link>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball</link>
		<comments>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball#comments</comments>
		<pubDate>Sat, 10 Apr 2010 22:04:48 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[face tracking]]></category>
		<category><![CDATA[microvision]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[showwx]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=502</guid>
		<description><![CDATA[www.youtube.com/watch?v=uRnBg9gflZM This idea, like most good ones, came to me while I was in my bathroom.  I recently took delivery of a Microvision SHOWWX laser pico projector, and I was trying to come up with a quick project to show the cool stuff it could do.  I noticed that the light above my mirror was [...]]]></description>
			<content:encoded><![CDATA[<p><span class="youtube">
<object width="700" height="420">
<param name="movie" value="http://www.youtube.com/v/uRnBg9gflZM&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showsearch=0?rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/uRnBg9gflZM&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showsearch=0?rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="700" height="420"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=uRnBg9gflZM">www.youtube.com/watch?v=uRnBg9gflZM</a></p></p>
<p>This idea, like most good ones, came to me while I was in my bathroom.  I recently took delivery of a <a href="http://www.microvision.com/showwx/index.html">Microvision SHOWWX</a> laser pico projector, and I was trying to come up with a quick project to show the cool stuff it could do.  I noticed that the light above my mirror was diffused by a large frosted glass dome, which led to this strange project.  It&#8217;ll probably make more sense around Halloween.</p>
<p><a href="http://eclecti.cc/files/2010/04/showwx.jpg"><img class="aligncenter size-large wp-image-503" title="The shot is blurry because my tripod is in the picture." src="http://eclecti.cc/files/2010/04/showwx-700x466.jpg" alt="Microvision SHOWWX Setup" width="700" height="466" /></a></p>
<p>The software is pretty similar to what I wrote the last time I did <a href="http://eclecti.cc/olpc/pyeyes-xeyes-in-python-with-face-tracking">face tracking</a>:  OpenCV&#8217;s very convenient Haar feature detection along with Pygame to do the image display.  I tried taking a picture of my own eye, but Flickr user Sarah Cartwright&#8217;s is <a href="http://www.flickr.com/photos/sarahcartwright/369063792/">much more photogenic</a> and available under Creative Commons Attribution-Share Alike.</p>
<p><a href="http://eclecti.cc/files/2010/04/evileye.jpg"><img class="aligncenter size-large wp-image-504" title="Now I just need to figure out how to get the camera inside the dome." src="http://eclecti.cc/files/2010/04/evileye-700x466.jpg" alt="Inside the Eye" width="700" height="466" /></a></p>
<p>A regular pico projector would probably work  as well, but the contrast ratio on this thing means it looks like the  iris is being projected by itself.  I have some much cooler projects planned that will really take advantage of the focus free nature of the laser projector.  In the mean time, the code for this project is available below.  The image is CC A-SA, the code is <a href="http://creativecommons.org/licenses/publicdomain/">public domain</a>, and the Haar file is Intel License Agreement<a href="http://creativecommons.org/licenses/BSD/"></a> like the rest of <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a>.  I also attached the Python script itself for perusal by search engines or folks who just want to see the code.</p>
<p><strong>Download:<br />
<a href="http://eclecti.cc/files/2010/04/EvilEye.zip">EvilEye.zip</a><br />
<a href="http://eclecti.cc/files/2010/04/EvilEye.py">EvilEye.py</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Failed Hack: Boogie Board LCD Writing Tablet</title>
		<link>http://eclecti.cc/hardware/a-failed-hack-boogie-board-lcd-writing-tablet</link>
		<comments>http://eclecti.cc/hardware/a-failed-hack-boogie-board-lcd-writing-tablet#comments</comments>
		<pubDate>Mon, 15 Mar 2010 01:22:38 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[boogie board]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[msp430]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=495</guid>
		<description><![CDATA[Sometimes a project is just not meant to be.  I picked up a Boogie Board LCD Writing Tablet when they went on sale to satiate my gadget addiction.  I didn&#8217;t expect it to be hackable, as it is little more than a glorified chalkboard, but I figured I&#8217;d give it a try.  My goal was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/03/boogieboard.jpg"><img class="alignnone size-large wp-image-496" title="The fancy depth of field is because I finally got a DSLR, the Canon T2i." src="http://eclecti.cc/files/2010/03/boogieboard-700x466.jpg" alt="Boogie Board Internals" width="700" height="466" /></a></p>
<p>Sometimes a project is just not meant to be.  I picked up a <a href="http://www.myboogieboard.com/">Boogie Board LCD Writing Tablet</a> when they went on sale to satiate my gadget addiction.  I didn&#8217;t expect it to be hackable, as it is little more than a glorified chalkboard, but I figured I&#8217;d give it a try.  My goal was to be able to lighten what was drawn on the screen, rather than erase it completely, to allow for the possibility of greyscale, or greenscale in this case.</p>
<p>I cracked it open (literally, I didn&#8217;t realize there were screws under the sticker), and found a more complex machine than I expected.  The brains of the tablet are an <a href="http://focus.ti.com/docs/prod/folders/print/msp430f2001.html">MSP430F2001</a>, one of the cheaper microcontrollers in TI&#8217;s MSP430 lineup.  The header on the left hooks up to the programming pins, so anyone out there with a <a href="http://goodfet.sourceforge.net/">GoodFET</a> might want to take a look at writing new firmware for it.  Unfortunately, I didn&#8217;t have one.</p>
<p>The waveform below captured between the two big pads, TP1 and TP2, shows how the cholesteric LCD refreshes.  On pressing the button, the power circuitry on the left generates 36v for 400ms, followed by 18v for 800ms, and feeds it to the multiplexer on the right.  The MSP430 toggles the input pins on the mux to switch that input voltage back and forth between the two pads in 150ms pulses, flashing the screen green and black and clearing what was drawn on it.</p>
<p><a href="http://eclecti.cc/files/2010/03/boogieboardwaveform.png"><img class="aligncenter size-full wp-image-497" title="The fancy waveform is because I finally got a DSO, the Rigol DS1052E." src="http://eclecti.cc/files/2010/03/boogieboardwaveform.png" alt="Boogie Board Waveform" width="640" height="468" /></a></p>
<p>Unfortunately, while lifting the PCB up to see the traces on the bottom,  I snapped one of the connections to the LCD, rendering the tablet  useless.  Hopefully someone can pick up where I left off, modify the  firmware on the MSP430, and see if its possible to make the LCD go only partway cleared by using shorter or fewer pulses.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/a-failed-hack-boogie-board-lcd-writing-tablet/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Walk This Way: Pedestrian Traffic Light Status Indicator</title>
		<link>http://eclecti.cc/hardware/walk-this-way-pedestrian-traffic-light-status-indicator</link>
		<comments>http://eclecti.cc/hardware/walk-this-way-pedestrian-traffic-light-status-indicator#comments</comments>
		<pubDate>Mon, 15 Feb 2010 01:20:24 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[overkill]]></category>
		<category><![CDATA[relay]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=475</guid>
		<description><![CDATA[A recent Slashdot post about Weird Stuff Warehouse reminded me that they carry cheap pedestrian traffic lights. I&#8217;d been meaning to pick one up to use as a completely overkill status indicator at work.  I managed to get this one for $10. It is a GE PS7-CFC1-01A that uses LEDs and looks new, but was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/02/dontwalk.jpg"><img class="alignnone size-large wp-image-473" title="That's a disassembled Boogie Board in the background.  More on that later." src="http://eclecti.cc/files/2010/02/dontwalk-700x525.jpg" alt="Traffic Sign Status Indicator" width="700" height="525" /></a></p>
<p>A recent Slashdot post about <a href="http://www.weirdstuff.com/">Weird Stuff Warehouse</a> reminded me that they carry cheap pedestrian traffic lights.  I&#8217;d been meaning to pick one up to use as a completely overkill status indicator at work.  I managed to get this one for $10.  It is a <a href="http://www.econolite.com/docs/accessories/ge_16x18_ped_module.pdf">GE PS7-CFC1-01A</a> that uses LEDs and looks new, but was presumably dumped by the original owner because it is a basic stop/go light without a countdown timer or accessibility features.</p>
<p><a href="http://eclecti.cc/files/2010/02/powersupplies.jpg"><img class="alignnone size-large wp-image-474" title="It's just asking to be replaced by a Mooninite." src="http://eclecti.cc/files/2010/02/powersupplies-700x525.jpg" alt="Dual Power Supplies" width="700" height="525" /></a></p>
<p>There were three mystery wires coming out of the back to interface it, so I cracked it open to see what was inside.  The stop hand and walk person have independent AC-DC power supplies.  Both halves share the white neutral wire, while each has a live wire of its own.  The idea is to have the common line always connected to neutral while switching the hot line to whichever half you want lit up.  Note that there is some additional circuitry on the right and an optoisolator connecting the halves.  I believe this sign was designed such that if you attempt to power on both halves simultaneously, it will fail safe and light only the stop half.</p>
<p><a href="http://eclecti.cc/files/2010/02/relay.jpg"><img class="alignnone size-large wp-image-476" title="Try this at home, but follow the one hand rule when playing with household AC." src="http://eclecti.cc/files/2010/02/relay-700x525.jpg" alt="Traffic Sign Relay" width="700" height="525" /></a></p>
<p>People often get their hearts broken on Valentine&#8217;s Day.  Frying mine by playing with 120v AC is one way to do that.  Kidding. Household AC is fine to tinker with as long as you&#8217;re careful.  I built the circuit from the <a href="http://www.arduino.cc/playground/uploads/Main/relays.pdf">Arduino Relay</a> guide to do the switching.  I picked up a SPDT 5v power relay to make it easy to run off of the Arduino.  The transistor is still necessary because the AVR can&#8217;t drive the 100+mA the relay needs to switch itself.  I used an ATX power supply socket for convenience, rather than cutting a cable and using that.  The neutral line from the socket is soldered to the neutral line on the sign.  Each of the hot lines from the sign is connected to one of the relay throw positions, while the hot line from the socket is connected to the relay pole.  Thus, toggling a pin high or low on the Arduino will flip the hot line from one half to the other, powering either the stop or go sign on.  The project in total cost less than $20.  It probably would have been under $15, but Radioshack is the only electronics store open on Sundays.</p>
<p>The code on the Arduino end is pretty simple.  It just reads a character off the serial port and flips the relay one way or the other.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define RELAY_PIN 13</span>
bool state<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  state <span style="color: #339933;">=</span> LOW<span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>RELAY_PIN<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  digitalWrite<span style="color: #009900;">&#40;</span>RELAY_PIN<span style="color: #339933;">,</span> state<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Serial.<span style="color: #202020;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    byte in <span style="color: #339933;">=</span> Serial.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>in <span style="color: #339933;">==</span> <span style="color: #ff0000;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      state <span style="color: #339933;">=</span> LOW<span style="color: #339933;">;</span>
      Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Switching relay to Stop.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>in <span style="color: #339933;">==</span> <span style="color: #ff0000;">'1'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      state <span style="color: #339933;">=</span> HIGH<span style="color: #339933;">;</span>
      Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Switching relay to Go.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    digitalWrite<span style="color: #009900;">&#40;</span>RELAY_PIN<span style="color: #339933;">,</span> state<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The computer end can be whatever you want it to be.  For example, in Python, you can use <a href="http://pyserial.sourceforge.net">pySerial</a> as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> serial
<span style="color: #66cc66;">&gt;&gt;&gt;</span> sign = serial.<span style="color: black;">Serial</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/dev/ttyUSB0'</span>,<span style="color: #ff4500;">9600</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> sign.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'0'</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> sign.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'1'</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/walk-this-way-pedestrian-traffic-light-status-indicator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Absolute Orientation: PNI SpacePoint Fusion in Python</title>
		<link>http://eclecti.cc/hardware/easy-absolute-orientation-pni-spacepoint-fusion-in-python</link>
		<comments>http://eclecti.cc/hardware/easy-absolute-orientation-pni-spacepoint-fusion-in-python#comments</comments>
		<pubDate>Mon, 01 Feb 2010 08:42:21 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[magnetometer]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[spacepoint fusion]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=414</guid>
		<description><![CDATA[My college roommate Donnie mentioned the PNI SpacePoint Fusion in comments of the HMC5843 post, and it seemed too good to be true.  A 9 DOF controller (3 axes each of magnetometer, accelerometer, and gyro) with a Kalman filter to calculate a smooth quaternion that interfaces as a USB HID device, all for under $100.  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/01/spacepoint.jpg"><img class="alignnone size-large wp-image-439" title="That is the cel shading tutorial from Panda3D, with the character quaternion set by the SpacePoint Fusion." src="http://eclecti.cc/files/2010/01/spacepoint-700x525.jpg" alt="SpacePoint Fusion" width="700" height="525" /></a></p>
<p>My college roommate Donnie mentioned the <a href="http://www.pnicorp.com/products/all/spacepoint-fusion">PNI SpacePoint Fusion</a> in comments of the <a href="http://eclecti.cc/hardware/hmc5843-magnetometer-library-for-arduino">HMC5843 post</a>, and it seemed too good to be true.  A 9 DOF controller (3 axes each of magnetometer, accelerometer, and gyro) with a <a href="http://en.wikipedia.org/wiki/Kalman_filter">Kalman filter</a> to calculate a smooth quaternion that interfaces as a USB HID device, all for under $100.  I&#8217;d be surprised if PNI is making any profit on it.  I sound more like a shill than I&#8217;m normally comfortable with, but I&#8217;m truly impressed with this gadget.  I have some plans for it involving a <a href="http://www.microvision.com/showwx/">Microvision SHOWWX</a> that I&#8217;m quite excited about; I&#8217;ll write more on that when it&#8217;s available in a couple of months.</p>
<p><a href="http://eclecti.cc/files/2010/01/innards.jpg"><img class="alignnone size-large wp-image-442" title="There's a mini usb port inside too, how convenient!" src="http://eclecti.cc/files/2010/01/innards-700x525.jpg" alt="SpacePoint Fusion Innards" width="700" height="525" /></a></p>
<p>PNI provides some Windows only <a href="http://www.pnicorp.com/support/downloads/spacepoint-fusion">sample apps</a> that show off how weirdly stable and precise the SpacePoint Fusion is.  Luckily, since it&#8217;s a normal USB HID device (redundant, I know), and PNI provides <a href="http://www.pnicorp.com/files/SpacePoint%20Fusion%20Game%20Pad%20Application%20Note.pdf">application notes</a>, it&#8217;s easy to use on any platform.  I wrote a Python module that uses <a href="http://libhid.alioth.debian.org/">libhid</a> via python-hid to make it easy to prototype with in Linux.  The usage is pretty simple, as shown below.  Note that when plugging the device in, you need to keep it still for a few seconds while the gyros are calibrated.  After that, the quaternion, accelerometer, and button data can be updated 62.5 times a second.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> spacepoint
<span style="color: #66cc66;">&gt;&gt;&gt;</span> fusion = spacepoint.<span style="color: black;">SpacePoint</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>fusion.<span style="color: black;">quat</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span><span style="color: #ff4500;">0.987518310546875</span>, -<span style="color: #ff4500;">0.04425048828125</span>, -<span style="color: #ff4500;">0.04119873046875</span>, <span style="color: #ff4500;">0.145294189453125</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>fusion.<span style="color: black;">accel</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span>-<span style="color: #ff4500;">0.054016113354999999</span>, <span style="color: #ff4500;">0.018859863306999999</span>, -<span style="color: #ff4500;">0.89648437622400001</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>fusion.<span style="color: black;">buttons</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> fusion.<span style="color: black;">update</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>fusion<span style="color: black;">&#41;</span>
accel: <span style="color: black;">&#40;</span>-<span style="color: #ff4500;">0.054016113354999999</span>, <span style="color: #ff4500;">0.018859863306999999</span>, -<span style="color: #ff4500;">0.89648437622400001</span><span style="color: black;">&#41;</span>
 quat: <span style="color: black;">&#40;</span><span style="color: #ff4500;">0.97186279296875</span>, -<span style="color: #ff4500;">0.233428955078125</span>, -<span style="color: #ff4500;">0.030548095703125</span>, <span style="color: #ff4500;">0.005401611328125</span><span style="color: black;">&#41;</span>
 buttons: <span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>Update on February 7, 2010:</strong> I emailed PNI about a bug in the firmware, and got the following response:</p>
<blockquote><p>Thank you for submitting the SpacePoint bug regarding libusb, Python, and Linux.  You&#8217;re right!  There is a bug in the SpacePoint FW that prevented opening interface 1 without opening interface 0 when using libusb under Linux.  While your work around was effective in allowing the device to operate normally, one should be able to open interface 1 directly without the work around.  We were able to use your Python source code to quickly diagnose and repair the bug.  Please see the attached for the modified Python script.  Please feel free to post this paragraph, the modified code, and all bragging rights on your blog (http://eclecti.cc/).</p></blockquote>
<p>Units being shipped now have the fix.  I modified the Python module to handle units both with and without the firmware fix and bumped the version to 0.2.</p>
<p><strong>Download:<a href="http://eclecti.cc/files/2010/02/spacepoint-0.2.tar.gz"><br />
SpacePoint Python Module</a></strong> or<br />
Standalone <strong><a href="http://eclecti.cc/files/2010/01/spacepoint.py">spacepoint.py</a></strong></p>
<h3>Setting udev rules to get the permissions right</h3>
<p>In most cases, the module will just work properly.  However, if you get the following error, you probably don&#8217;t have the right permissions to access the usb device.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> spacepoint
<span style="color: #66cc66;">&gt;&gt;&gt;</span> fusion = spacepoint.<span style="color: black;">SpacePoint</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
hid_force_open failed <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">code</span> 12.</pre></div></div>

<p>On most modern Linux distros, you can fix this by setting a <a href="http://reactivated.net/writing_udev_rules.html">udev rule</a> for the device.  In Ubuntu Karmic Koala, saving the following as <code>/etc/udev/rules.d/45-spacepoint.rules</code> , running <code>sudo service udev restart</code> , and then unplugging and replugging in the device should fix it:</p>

<div class="wp_syntax"><div class="code"><pre class="cmake" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># PNI SpacePoint Fusion</span>
SYSFS{idVendor}==<span style="color: #912f11;">&quot;20ff&quot;</span>, SYSFS{idProduct}==<span style="color: #912f11;">&quot;0100&quot;</span>, MODE=<span style="color: #912f11;">&quot;0664&quot;</span>, GROUP=<span style="color: #912f11;">&quot;admin&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/easy-absolute-orientation-pni-spacepoint-fusion-in-python/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sleep Remaining Indicator: A Laser Alarm Clock</title>
		<link>http://eclecti.cc/hardware/sleep-remaining-indicator-a-laser-alarm-clock</link>
		<comments>http://eclecti.cc/hardware/sleep-remaining-indicator-a-laser-alarm-clock#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:15:19 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[chumby]]></category>
		<category><![CDATA[laser]]></category>
		<category><![CDATA[servo]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=399</guid>
		<description><![CDATA[The chunk of title after the colon intends to serve as an explanation of what a sleep remaining indicator is. However, this project is neither an alarm nor a clock. It is a visual indicator of approximately how much time I have remaining to sleep in the night. This may not be a problem you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/01/sleepremainingindicator.jpg"><img class="alignnone size-large wp-image-401" title="The original plan was to use an ATTiny85, but I ran out of resonators." src="http://eclecti.cc/files/2010/01/sleepremainingindicator-700x525.jpg" alt="Sleep remaining indicator" width="700" height="525" /></a></p>
<p>The chunk of title after the colon intends to serve as an explanation of what a sleep remaining indicator is.  However, this project is neither an alarm nor a clock.  It is a visual <em>indicator</em> of approximately how much time I have <em>remaining</em> to <em>sleep</em> in the night.</p>
<p>This may not be a problem you need solved.  If, however, like me you wear glasses or contacts, the world when you are in bed turns into a blurry mess.  Normally I reach over and unlock my phone or lean over and squint at my <a href="http://www.chumby.com/">Chumby One</a>, but those actions make it harder to get back to sleep.  What I wanted was a way to instantly know how much longer I could sleep before my alarm would go off.</p>
<p>My solution involves a line laser, a servo, and an Arduino.  I set a potentiometer with a number dial to approximately the right length of time in hours and hit the reset button.  The servo with the line laser attached will shine the laser line onto the ceiling.  The servo will then slowly rotate, moving the laser line underneath a cover made of Lego pieces, making the length of line showing on the ceiling shrink over the hours.  It&#8217;s a little like an hourglass, but with lasers.</p>
<p><a href="http://eclecti.cc/files/2010/01/laserline.jpg"><img class="alignnone size-large wp-image-400" title="It's being powered off the Chumby for convenience." src="http://eclecti.cc/files/2010/01/laserline-700x525.jpg" alt="Laser line" width="700" height="525" /></a></p>
<p>Here&#8217;s the Arduino sketch.  Use it under whatever license you want.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Sleep Remaining Indicator v1.0
 * by Nirav Patel &lt;http://eclecti.cc&gt;
 */</span>
&nbsp;
<span style="color: #339933;">#include &lt;Servo.h&gt;</span>
<span style="color: #339933;">#include &lt;math.h&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//#define photoPin 1</span>
<span style="color: #666666; font-style: italic;">//#define laserPin 9</span>
<span style="color: #339933;">#define potPin 0</span>
<span style="color: #339933;">#define servoPin 10</span>
<span style="color: #339933;">#define M_PI_4 (M_PI/4.0)</span>
<span style="color: #339933;">#define MINSERVO 1190 // The laser line is no longer visible</span>
<span style="color: #339933;">#define MAXSERVO 1810 // The laser line is at its longest</span>
&nbsp;
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> startTime<span style="color: #339933;">;</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> totalTime<span style="color: #339933;">;</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> lastVal<span style="color: #339933;">;</span>
Servo laserServo<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//  pinMode(photoPin, INPUT);</span>
  pinMode<span style="color: #009900;">&#40;</span>potPin<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// this magic converts the pot value to 0 to 9 hours in milliseconds.</span>
  totalTime <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span><span style="color: #009900;">&#41;</span><span style="color: #0000dd;">31641</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1024</span><span style="color: #339933;">-</span>analogRead<span style="color: #009900;">&#40;</span>potPin<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Time in hours: '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">double</span><span style="color: #009900;">&#41;</span>totalTime<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">double</span><span style="color: #009900;">&#41;</span><span style="color:#800080;">3600000.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  laserServo.<span style="color: #202020;">attach</span><span style="color: #009900;">&#40;</span>servoPin<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  startTime <span style="color: #339933;">=</span> millis<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  lastVal <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// The laser brightness should depend on the ambient light in the room.</span>
  <span style="color: #666666; font-style: italic;">// Unfortunately, my laser dislikes PWM, so I just have it hooked to 3.3v</span>
<span style="color: #666666; font-style: italic;">//  unsigned int light = analogRead(photoPin);</span>
<span style="color: #666666; font-style: italic;">//  analogWrite(laserPin,light&gt;&gt;2);</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// calculate the time we've been running (well, sleeping)</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> time <span style="color: #339933;">=</span> millis<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span>startTime<span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Note that one could use this as an alarm clock by setting off a buzzer or</span>
  <span style="color: #666666; font-style: italic;">// even having the servo rotate loudly</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>time <span style="color: #339933;">&gt;</span> totalTime<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    laserServo.<span style="color: #202020;">writeMicroseconds</span><span style="color: #009900;">&#40;</span>MINSERVO<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// This trig makes the line length shrink uniformly over time.</span>
  time <span style="color: #339933;">=</span> totalTime<span style="color: #339933;">-</span>time<span style="color: #339933;">;</span>
  <span style="color: #993333;">double</span> angle <span style="color: #339933;">=</span> atan2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">double</span><span style="color: #009900;">&#41;</span>time<span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">double</span><span style="color: #009900;">&#41;</span>totalTime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> servoVal <span style="color: #339933;">=</span>  <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>angle<span style="color: #339933;">/</span>M_PI_4<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">double</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>MAXSERVO<span style="color: #339933;">-</span>MINSERVO<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span>MINSERVO<span style="color: #339933;">;</span>
&nbsp;
  servoVal <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>servoVal <span style="color: #339933;">&gt;</span> MAXSERVO<span style="color: #339933;">?</span> MAXSERVO <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span>servoVal <span style="color: #339933;">&lt;</span> MINSERVO <span style="color: #339933;">?</span> MINSERVO <span style="color: #339933;">:</span> servoVal<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// The servo is imperfect, so don't move unless the value actually changed</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>servoVal <span style="color: #339933;">!=</span> lastVal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>servoVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    laserServo.<span style="color: #202020;">writeMicroseconds</span><span style="color: #009900;">&#40;</span>servoVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    lastVal <span style="color: #339933;">=</span> servoVal<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// tick like a clock</span>
  delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/hardware/sleep-remaining-indicator-a-laser-alarm-clock/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Urban Moonshining: Home Distilling for Fun and (not) Profit</title>
		<link>http://eclecti.cc/bytes/urban-moonshining-home-distilling-for-fun-and-not-profit</link>
		<comments>http://eclecti.cc/bytes/urban-moonshining-home-distilling-for-fun-and-not-profit#comments</comments>
		<pubDate>Tue, 19 Jan 2010 07:23:04 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Bytes]]></category>
		<category><![CDATA[distilling]]></category>
		<category><![CDATA[homesteading]]></category>
		<category><![CDATA[moonshine]]></category>
		<category><![CDATA[rumbling]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=394</guid>
		<description><![CDATA[At some point in high school, my friends and I decided to learn the lost craft of home distillation. We started with the best of intentions (well, not really), but were unable to build stills that functioned until we hit college. Since then, we have just about perfected the process of distilling tasty, cheap rum [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eclecti.cc/files/2010/01/copperstill.jpg"><img src="http://eclecti.cc/files/2010/01/copperstill-700x465.jpg" alt="Copper Pot Still" title="Just what every home needs." width="700" height="465" class="alignnone size-large wp-image-395" /></a><br />
At some point in high school, my friends and I decided to learn the lost craft of home distillation.  We started with the best of intentions (well, not really), but were unable to build stills that functioned until we hit college.  Since then, we have just about perfected the process of distilling tasty, cheap rum on a stove top.  <a href="http://rumblings.org">John Martin</a> has chronicled our steps and missteps over the years in a series of blog posts.  The first three cover <a href="http://johngmartin.wordpress.com/2010/01/03/distilling-part-1/">the background story</a>, the basics of <a href="http://johngmartin.wordpress.com/2010/01/10/distilling-part-2/">fermenting a rum wash</a>, and the general <a href="http://http://johngmartin.wordpress.com/2010/01/15/distilling-part-3/">process of distillation</a>.  The final post covers the specifics of <a href="http://johngmartin.wordpress.com/2010/01/18/diy-still/">urban moonshining</a>; that is, plans for a micro still that allows for home distilling within the confines of the average apartment.</p>
<p><a href="http://eclecti.cc/files/2010/01/stovetopstill.jpg"><img src="http://eclecti.cc/files/2010/01/stovetopstill-700x465.jpg" alt="Stove Top Still" title="You are $50 of parts and $5 of material away from a liter of rum." width="700" height="465" class="alignnone size-large wp-image-396" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/bytes/urban-moonshining-home-distilling-for-fun-and-not-profit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
