<?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>C i b o M a h t o . c o m</title>
	<atom:link href="http://www.cibomahto.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cibomahto.com</link>
	<description>building making designing dreaming</description>
	<lastBuildDate>Fri, 27 Aug 2010 16:38:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>I sold my first kit!</title>
		<link>http://www.cibomahto.com/2010/08/i-sold-my-first-kit/</link>
		<comments>http://www.cibomahto.com/2010/08/i-sold-my-first-kit/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 16:38:36 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1445</guid>
		<description><![CDATA[On Wednesday, I took a big step into the world of kit making, when I designed and sold my first product! This one is called the &#8216;D.I.Y. Cow Kit&#8217;, and was purchased by Drew Fustini of PS1. Thanks, Drew! Unfortunately, &#8230; <a href="http://www.cibomahto.com/2010/08/i-sold-my-first-kit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cibomahto.com/2010/08/i-sold-my-first-kit/attachment/152015542/" rel="attachment wp-att-1446"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/152015542.jpg" alt="" title="152015542" width="600" height="451" class="alignnone size-full wp-image-1446" /></a></p>
<p>On Wednesday, I took a big step into the world of kit making, when I designed and sold my first product! This one is called the &#8216;D.I.Y. Cow Kit&#8217;, and was purchased by <a href="http://twitter.com/pdp7">Drew Fustini</a> of PS1. Thanks, Drew!</p>
<p>Unfortunately, this kit was sold as an edition of 1, so I am already out of stock. However, you can still purchase a <a href="http://www.cibomahto.com/2010/08/double-resistor-what-does-it-mean/">poster</a>, or contact me if you would like a special kit commissioned just for you!</p>
<p>Thanks also to the fine folks at CCCKC, who provided the papercraft cow substrate that I &#8216;hacked&#8217; to design my kit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/i-sold-my-first-kit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Double resistor! What does it mean?</title>
		<link>http://www.cibomahto.com/2010/08/double-resistor-what-does-it-mean/</link>
		<comments>http://www.cibomahto.com/2010/08/double-resistor-what-does-it-mean/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 00:09:08 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1431</guid>
		<description><![CDATA[See here and here if this doesn&#8217;t make any sense. Source file here Fund my travels! Purchase an authentic copy of this poster for only $15, while supplies last! Includes shipping to North America!:]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cibomahto.com/2010/08/double-resistor-what-does-it-mean/rainbow/" rel="attachment wp-att-1432"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/rainbow-463x600.png" alt="" title="rainbow" width="463" height="600" class="alignnone size-medium wp-image-1432" /></a><br />
See <a href="http://www.youtube.com/watch?v=OQSNhk5ICTI">here</a> and <a href="http://en.wikipedia.org/wiki/Electronic_color_code">here</a> if this doesn&#8217;t make any sense.<br />
<a href='http://www.cibomahto.com/wp-content/uploads/2010/08/resistor_color_codes.svg_.zip'>Source file here</a></p>
<p>Fund my travels! Purchase an authentic copy of this poster for only $15, while supplies last! Includes shipping to North America!:<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="S2755HYZLKSTW">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/double-resistor-what-does-it-mean/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How-To: Build a soldering iron stand from a coathanger</title>
		<link>http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/</link>
		<comments>http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 21:07:29 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1417</guid>
		<description><![CDATA[At the workshop at Blooming Labs in Bloomington, IN, we were short a couple of soldering stands. Mitch showed us this nice trick for replacement stands using a standard coat hanger and some wire cutters, so I wrote up some &#8230; <a href="http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/dsc_2486/" rel="attachment wp-att-1425"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/DSC_2486-600x399.jpg" alt="" title="DSC_2486" width="600" height="399" class="alignnone size-medium wp-image-1425" /></a></p>
<p>At the workshop at Blooming Labs in Bloomington, IN, we were short a couple of soldering stands. Mitch showed us this nice trick for replacement stands using a standard coat hanger and some wire cutters, so I <a href="http://makeprojects.com/Project/DIY-soldering-iron-stand/213/1">wrote up some quick directions</a> so that others would be able to make them as well. Also, I made one into a fish:</p>
<p><a href="http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/diy_soldering_stand_fish/" rel="attachment wp-att-1426"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/diy_soldering_stand_fish.jpg" alt="" title="diy_soldering_stand_fish" width="600" height="399" class="alignnone size-full wp-image-1426" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/how-to-build-a-soldering-iron-stand-from-a-coathanger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idea: Fake lemonade stand</title>
		<link>http://www.cibomahto.com/2010/08/idea-fake-lemonaide-stand/</link>
		<comments>http://www.cibomahto.com/2010/08/idea-fake-lemonaide-stand/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 20:29:30 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/2010/08/idea-fake-lemonaide-stand/</guid>
		<description><![CDATA[The idea is to bring the feel of a  slow-paced country road to an interstate highway, by placing an iconic lemonade stand in the in the center of said thoroughfare. To match the plastic aesthetic of the superhighway, however, the &#8230; <a href="http://www.cibomahto.com/2010/08/idea-fake-lemonaide-stand/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a alt="image" href="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-20-14.30.592.jpg"><img  alt="image" src="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-20-14.30.591.jpg" /></a><br />
The idea is to bring the feel of a  slow-paced country road to an interstate highway, by placing an iconic lemonade stand in the in the center of said thoroughfare. To match the plastic aesthetic of the superhighway, however, the stand itself will actually be a false caricature of a real stand, complete with fake lemonade and a robotic dummy that will enthusiastically wave at approaching vehicles, and assume a dejected expression when they inevitably speed by.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/idea-fake-lemonaide-stand/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Laser sight for DSLR camera</title>
		<link>http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/</link>
		<comments>http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 15:49:47 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1403</guid>
		<description><![CDATA[Want to shoot photos from the hip, but having a hard time aiming? Jealous of all those hunters with their fancy targeting optics? Well, we have the solution for you- a focused coherent light source for your lens shield! Calibration &#8230; <a href="http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/samsung/" rel="attachment wp-att-1409"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/laser_sight.jpg" alt="" title="SAMSUNG" width="600" height="450" class="alignnone size-full wp-image-1409" /></a></p>
<p><object width="600" height="361"><param name="movie" value="http://www.youtube.com/v/iRKC-h40vkI?fs=1&#038;hl=en&#038;start=0&#038;fs=1&#038;rel=0&#038;showinfo=0&#038;ap=%2526fmt%3D18"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/iRKC-h40vkI?fs=1&#038;hl=en&#038;start=0&#038;fs=1&#038;rel=0&#038;showinfo=0&#038;ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="361"></embed></object></p>
<p>Want to shoot photos from the hip, but having a hard time aiming? Jealous of all those hunters with their fancy targeting optics? Well, we have the solution for you- a focused coherent light source for your lens shield! Calibration can be achieved by careful adjustment using scrap parchment.</p>
<p>Not particularly recommended for use in airports or political rallies.</p>
<p>Sample image:</p>
<p><a href="http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/catch_thieves/" rel="attachment wp-att-1414"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/catch_thieves.jpg" alt="" title="catch_thieves" width="600" height="399" class="alignnone size-full wp-image-1414" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/laser-sight-for-dslr-camera/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Idea: Multi-player frogger based on hex tile layout</title>
		<link>http://www.cibomahto.com/2010/08/idea-multi-player-frogger-based-on-hex-tile-layout/</link>
		<comments>http://www.cibomahto.com/2010/08/idea-multi-player-frogger-based-on-hex-tile-layout/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 06:04:50 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/2010/08/idea-multi-player-frogger-based-on-hex-tile-layout/</guid>
		<description><![CDATA[The classic arcade game based around the journeys of our amphibian friend has been a favorite for decades, however the advent of fast-paced multiplayer social entertainment threatens to leave its single player design in a entertainment backwater. Inspired by the &#8230; <a href="http://www.cibomahto.com/2010/08/idea-multi-player-frogger-based-on-hex-tile-layout/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a alt="image" href="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-19-01.34.171.jpg"><img  alt="image" src="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-19-01.34.17.jpg" /></a></p>
<p>The classic arcade game based around the journeys of our amphibian friend has been a favorite for decades, however the advent of fast-paced multiplayer social entertainment threatens to leave its single player design in a entertainment backwater. Inspired by the byzantine intersections found in many older cities, the hex tile frogger concept provides a path forward for the modernization of this beloved game. By combining the primal desire for shelter with the ancient game of Chinese checkers, the updated game presents a challenging game for up to six simultaneous players, while still staying true to the original concepts of dodging traffic and finding nourishment. Bonus points if the environment is updated to reflect the three dimensional topology of hilly cities.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/idea-multi-player-frogger-based-on-hex-tile-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LoL + Processing</title>
		<link>http://www.cibomahto.com/2010/08/lol-processing/</link>
		<comments>http://www.cibomahto.com/2010/08/lol-processing/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 16:28:02 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1385</guid>
		<description><![CDATA[On the train back from NYC to Pittsburgh, I got the idea to hook up the LoL Shield directly to my computer, so that I could develop animations for it using a desktop graphics program. Using Jay Clegg&#8217;s Video Peggy &#8230; <a href="http://www.cibomahto.com/2010/08/lol-processing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cibomahto.com/2010/08/lol-processing/lol_framebuffer/" rel="attachment wp-att-1389"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/lol_framebuffer.jpg" alt="" title="lol_framebuffer" width="600" height="378" class="alignnone size-full wp-image-1389" /></a></p>
<p>On the train back from NYC to Pittsburgh, I got the idea to hook up the <a href="http://jimmieprodgers.com/kits/lolshield/">LoL Shield</a> directly to my computer, so that I could develop animations for it using a desktop graphics program. Using Jay Clegg&#8217;s <a href="http://www.planetclegg.com/projects/QC-Peggy.html">Video Peggy</a> project as a starting point, I wrote up a little framebuffer sketch for the Arduino, along with some <a href="http://processing.org/">Processing</a> code to grab a region of the computer screen, scale it, and send it over to the LoL Shield for display. Pretty simple, but could be useful. Source code is after the break. A version of this project might be included with the next LoL Shield library release.<span id="more-1385"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.serial.*</span><span style="color: #339933;">;</span>
&nbsp;
LolShieldBuffer lolShield<span style="color: #339933;">;</span>
PFont fontA<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">14</span>, <span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Load the font. Fonts must be placed within the data </span>
  <span style="color: #666666; font-style: italic;">// directory of your sketch. A font must first be created</span>
  <span style="color: #666666; font-style: italic;">// using the 'Create Font...' option in the Tools menu.</span>
  fontA <span style="color: #339933;">=</span> loadFont<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LucidaSans-9.vlw&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set the font and its size (in units of pixels)</span>
  textFont<span style="color: #009900;">&#40;</span>fontA, <span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// I know that the first port in the serial list on my mac</span>
  <span style="color: #666666; font-style: italic;">// is always my  FTDI adaptor, so I open Serial.list()[0].</span>
  <span style="color: #666666; font-style: italic;">// On Windows machines, this generally opens COM1.</span>
  <span style="color: #666666; font-style: italic;">// Open whatever port is the one you're using.</span>
  <span style="color: #003399;">String</span> portName <span style="color: #339933;">=</span> Serial.<span style="color: #006633;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  print<span style="color: #009900;">&#40;</span>portName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  lolShield <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LolShieldBuffer<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, portName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;The time is now &quot;</span> <span style="color: #339933;">+</span> hour<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;:&quot;</span> <span style="color: #339933;">+</span> minute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, i, <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  lolShield.sendWindow(mouseX,mouseY, 14, 9);</span>
  lolShield.<span style="color: #006633;">sendWindow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">14</span>, <span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  i<span style="color: #339933;">--;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">&lt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">130</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">14</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  delay<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You want to put this code on your Arduino:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &quot;Charliplexing.h&quot;</span>
<span style="color: #339933;">#include &quot;Font.h&quot;</span>
<span style="color: #339933;">#include &quot;WProgram.h&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Inspired by Video Peggy:</span>
<span style="color: #666666; font-style: italic;">// http://www.planetclegg.com/projects/QC-Peggy.html</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>                    <span style="color: #666666; font-style: italic;">// run once, when the sketch starts</span>
<span style="color: #009900;">&#123;</span>
  Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">115200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  LedSign<span style="color: #339933;">::</span><span style="color: #202020;">Init</span><span style="color: #009900;">&#40;</span>DOUBLE_BUFFER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//  LedSign::Init();</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">int</span> state <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> 
<span style="color: #993333;">int</span> counter <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">const</span> uint8_t DISP_BUFFER_SIZE <span style="color: #339933;">=</span> <span style="color: #0000dd;">9</span><span style="color: #339933;">*</span><span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>                     <span style="color: #666666; font-style: italic;">// run over and over again</span>
<span style="color: #009900;">&#123;</span> 
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</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><span style="color: #009900;">&#125;</span>
  uint8_t c <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>
&nbsp;
  <span style="color: #666666; font-style: italic;">// very simple state machine to look for 6 byte start of frame</span>
  <span style="color: #666666; font-style: italic;">// marker and copy bytes that follow into buffer</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">6</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// must wait for 0xdeadbeef to start frame.</span>
    <span style="color: #666666; font-style: italic;">// note, I look for two more bytes after that, but</span>
    <span style="color: #666666; font-style: italic;">// they are reserved for future use. </span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">&amp;&amp;</span> c <span style="color: #339933;">==</span> <span style="color: #208080;">0x12</span><span style="color: #009900;">&#41;</span> state<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&amp;&amp;</span> c <span style="color: #339933;">==</span> <span style="color: #208080;">0x34</span><span style="color: #009900;">&#41;</span> state<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span><span style="color: #0000dd;">2</span> <span style="color: #339933;">&amp;&amp;</span> c <span style="color: #339933;">==</span> <span style="color: #208080;">0x56</span><span style="color: #009900;">&#41;</span> state<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span><span style="color: #0000dd;">3</span> <span style="color: #339933;">&amp;&amp;</span> c <span style="color: #339933;">==</span> <span style="color: #208080;">0x78</span><span style="color: #009900;">&#41;</span> state<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span><span style="color: #0000dd;">4</span> <span style="color: #339933;">&amp;&amp;</span> c <span style="color: #339933;">==</span> <span style="color: #208080;">0x1</span><span style="color: #009900;">&#41;</span> state<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state <span style="color: #339933;">==</span><span style="color: #0000dd;">5</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// dont care what 6th byte is </span>
    <span style="color: #009900;">&#123;</span>
      state<span style="color: #339933;">++;</span>
      counter <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> state <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// error: reset to look for start of frame</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">else</span> 
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// inside of a frame, so write to the buffer</span>
    uint8_t row <span style="color: #339933;">=</span> counter <span style="color: #339933;">/</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>
    uint8_t col <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>counter <span style="color: #339933;">%</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #0000dd;">8</span><span style="color: #339933;">;</span>
    uint8_t length <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>col<span style="color: #339933;">==</span><span style="color: #0000dd;">0</span><span style="color: #339933;">?</span><span style="color: #0000dd;">8</span><span style="color: #339933;">:</span><span style="color: #0000dd;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>uint8_t colOffset <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>  colOffset <span style="color: #339933;">&lt;</span> length <span style="color: #339933;">;</span> colOffset<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      LedSign<span style="color: #339933;">::</span><span style="color: #202020;">Set</span><span style="color: #009900;">&#40;</span>col<span style="color: #339933;">+</span>colOffset<span style="color: #339933;">,</span> row<span style="color: #339933;">,</span> c <span style="color: #339933;">&gt;&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">7</span> <span style="color: #339933;">-</span> colOffset<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    counter<span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>counter <span style="color: #339933;">&gt;=</span> DISP_BUFFER_SIZE<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// buffer filled, so reset everything to wait for next frame</span>
      state <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
      LedSign<span style="color: #339933;">::</span><span style="color: #202020;">Flip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Put this code in a new tab in your Processing project, called LolShieldBuffer:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.serial.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> LolShieldBuffer
<span style="color: #009900;">&#123;</span>
  Serial serial<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">int</span> ledWidth <span style="color: #339933;">=</span> <span style="color: #cc66cc;">14</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">int</span> ledHeight <span style="color: #339933;">=</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">int</span> ledFrameSize <span style="color: #339933;">=</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  LolShieldBuffer<span style="color: #009900;">&#40;</span>PApplet parent, <span style="color: #003399;">String</span> portName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    serial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Serial<span style="color: #009900;">&#40;</span>parent, portName, <span style="color: #cc66cc;">115200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> sendWindow<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x, <span style="color: #000066; font-weight: bold;">int</span> y, <span style="color: #000066; font-weight: bold;">int</span> w, <span style="color: #000066; font-weight: bold;">int</span> h<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    PImage img <span style="color: #339933;">=</span> get<span style="color: #009900;">&#40;</span>x, y, w, h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//    img.resize(ledWidth, ledHeight);</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> frame <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span>ledFrameSize<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Grab a 14x9 window</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> row <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> row <span style="color: #339933;">&lt;</span> ledHeight<span style="color: #339933;">;</span> row<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">char</span> buf <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> col <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> col <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span> col<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        buf <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>buf <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        buf <span style="color: #339933;">|=</span> <span style="color: #009900;">&#40;</span>brightness<span style="color: #009900;">&#40;</span>img.<span style="color: #006633;">pixels</span><span style="color: #009900;">&#91;</span>row<span style="color: #339933;">*</span>ledWidth<span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">127</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      frame<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> buf<span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> col <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> col <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span> col<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        buf <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>buf <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        buf <span style="color: #339933;">|=</span> <span style="color: #009900;">&#40;</span>brightness<span style="color: #009900;">&#40;</span>img.<span style="color: #006633;">pixels</span><span style="color: #009900;">&#91;</span>row<span style="color: #339933;">*</span>ledWidth<span style="color: #339933;">+</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">127</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      buf <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>buf <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      frame<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> buf<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    sendFrame<span style="color: #009900;">&#40;</span>frame<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> sendFrame<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> frame<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> magicNumber <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>0x12, 0x34, 0x56, 0x78, 0x1, 0x0<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    serial.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>magicNumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// TODO: Drop 9*2 magic number</span>
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> index <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> index <span style="color: #339933;">&lt;</span> ledFrameSize<span style="color: #339933;">;</span> index<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      serial.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>frame<span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/lol-processing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programming the LoL Shield using animated GIFs</title>
		<link>http://www.cibomahto.com/2010/08/programming-the-lol-shield-using-animated-gifs/</link>
		<comments>http://www.cibomahto.com/2010/08/programming-the-lol-shield-using-animated-gifs/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 05:07:12 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1369</guid>
		<description><![CDATA[A couple of weeks ago, I was hacking on the LoL Shield with Nathan Rosenquist, when we realized that it was really time consuming to use the spreadsheet program to build animations. Never fear, a quick python script later and &#8230; <a href="http://www.cibomahto.com/2010/08/programming-the-lol-shield-using-animated-gifs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object width="600" height="406"><param name="movie" value="http://www.youtube.com/v/YJX4p--a90E?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/YJX4p--a90E?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="406"></embed></object><br />
A couple of weeks ago, I was hacking on the <a href="http://jimmieprodgers.com/kits/lolshield/">LoL Shield</a> with <a href="http://twitter.com/freeradicalx">Nathan Rosenquist</a>, when we realized that it was really time consuming to use the spreadsheet program to build animations. Never fear, a quick python script later and we could generate animations automatically from animated gifs.<br />
Using the program, you can take black &#038; white 14&#215;9 GIF animations of (probably) any length, such as the following one by Nathan:<br />
<a href="http://www.cibomahto.com/2010/08/programming-the-lol-shield-using-animated-gifs/ripple/" rel="attachment wp-att-1370"><img src="http://www.cibomahto.com/wp-content/uploads/2010/08/ripple.gif" alt="" title="ripple" width="14" height="9" class="alignnone size-full wp-image-1370" /></a></p>
<p>and get some code ready for the LoLing:</p>
<pre>
uint16_t ripple[][9] PROGMEM = {
 { 520 , 1028 , 2050 , 2050 , 2114 , 2050 , 2050 , 1028 , 520 , },
 { 2050 , 4097 , 4097 , 8256 , 8352 , 8256 , 4097 , 4097 , 2050 , },
 { 8192 , 8192 , 224 , 272 , 272 , 272 , 224 , 8192 , 8192 , },
 { 0 , 224 , 272 , 520 , 520 , 520 , 272 , 224 , 0 , },
 { 224 , 272 , 520 , 1028 , 1028 , 1028 , 520 , 272 , 224 , },
};
</pre>
<p>Here&#8217;s the python source, have fun! It requires Python and the Python Imaging Library (PIL):</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># Python script to convert a 14x9 pixel animated gif into a format that can</span>
<span style="color: #808080; font-style: italic;"># be displayed on the LoLShield.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Requires Python and the Python Imaging Library (PIL)</span>
<span style="color: #808080; font-style: italic;"># It would be nice if this was available using a more common language.</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">os</span>, Image
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> ImageSequence:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, im<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">im</span> = im
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__getitem__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, ix<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #ff7700;font-weight:bold;">if</span> ix:
                <span style="color: #008000;">self</span>.<span style="color: black;">im</span>.<span style="color: black;">seek</span><span style="color: black;">&#40;</span>ix<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">im</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">EOFError</span>:
            <span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">IndexError</span> <span style="color: #808080; font-style: italic;"># end of sequence</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Open image</span>
filename = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
filenameBase = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
im = Image.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Print the variable declaration</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;uint16_t &quot;</span> + filenameBase + <span style="color: #483d8b;">&quot;[][9] PROGMEM = {&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># For each frame in the image, convert it to black &amp; white, then into the</span>
<span style="color: #808080; font-style: italic;"># LoLShield format</span>
<span style="color: #ff7700;font-weight:bold;">for</span> frame <span style="color: #ff7700;font-weight:bold;">in</span> ImageSequence<span style="color: black;">&#40;</span>im<span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># Convert to black and white</span>
    converted = frame.<span style="color: black;">convert</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;1&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot; {&quot;</span>,
    frameString = converted.<span style="color: black;">tostring</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># For each row in the image</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> row <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">9</span><span style="color: black;">&#41;</span>:
        charA = <span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>frameString<span style="color: black;">&#91;</span>row<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        charB = <span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>frameString<span style="color: black;">&#91;</span>row<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span> + <span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
        rowTotal = <span style="color: #ff4500;">0</span>
        <span style="color: #808080; font-style: italic;"># Handle the first 8 bits</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> col <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">8</span><span style="color: black;">&#41;</span>:
            shiftAmount = <span style="color: #ff4500;">7</span>-col
            rowTotal += <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>charA <span style="color: #66cc66;">&gt;&gt;</span> shiftAmount<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span><span style="color: #66cc66;">**</span>col
        <span style="color: #808080; font-style: italic;"># Then the next 6</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> col <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span>:
            shiftAmount = <span style="color: #ff4500;">7</span>-col
            rowTotal += <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>charB <span style="color: #66cc66;">&gt;&gt;</span> shiftAmount<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span><span style="color: #66cc66;">**</span><span style="color: black;">&#40;</span>col+<span style="color: #ff4500;">8</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># And output the total for this row</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> rowTotal, <span style="color: #483d8b;">&quot;,&quot;</span>,
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;},&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;};&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/programming-the-lol-shield-using-animated-gifs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Idea: Ceiling cat smoke detector</title>
		<link>http://www.cibomahto.com/2010/08/idea-ceiling-cat-smoke-detector/</link>
		<comments>http://www.cibomahto.com/2010/08/idea-ceiling-cat-smoke-detector/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 00:41:59 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/2010/08/idea-ceiling-cat-smoke-detector/</guid>
		<description><![CDATA[Like any ceiling cat, the ceiling cat smoke detector watches you doing private things. This cat has another function, however- it also detects fire in your abode, and warmly alerts you to them with the moaning wail of an excited &#8230; <a href="http://www.cibomahto.com/2010/08/idea-ceiling-cat-smoke-detector/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a alt="image" href="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-11-19.45.331.jpg"><img  alt="image" src="http://www.cibomahto.com/wp-content/uploads/2010/08/wpid-2010-08-11-19.45.33.jpg" /></a></p>
<p>Like any ceiling cat, the ceiling cat smoke detector watches you doing private things. This cat has another function, however- it also detects fire in your abode, and warmly alerts you to them with the moaning wail of an excited feline who seeks affirmation of their existence through copulation. Bonus features include a rotating head, flashing eyes, and articulated mouth.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/idea-ceiling-cat-smoke-detector/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Midwest Workshop Tour of Hackerspaces</title>
		<link>http://www.cibomahto.com/2010/08/midwest-maker-tour/</link>
		<comments>http://www.cibomahto.com/2010/08/midwest-maker-tour/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 06:52:17 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=1356</guid>
		<description><![CDATA[For the rest of the month, I&#8217;m going on tour with Mitch Altman and Jimmie Rodgers as their official roadie. We&#8217;re visiting a number of hackerspaces in the Midwest, and holding soldering workshops at them. They started their journey a &#8230; <a href="http://www.cibomahto.com/2010/08/midwest-maker-tour/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object width="600" height="450"><param name="flashvars" value="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Fcibomahto%2Fsets%2F72157624576065507%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Fcibomahto%2Fsets%2F72157624576065507%2F&#038;set_id=72157624576065507&#038;jump_to="></param><param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Fcibomahto%2Fsets%2F72157624576065507%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Fcibomahto%2Fsets%2F72157624576065507%2F&#038;set_id=72157624576065507&#038;jump_to=" width="600" height="450"></embed></object></p>
<p>For the rest of the month, I&#8217;m going on tour with Mitch Altman and Jimmie Rodgers as their official roadie. We&#8217;re visiting a number of hackerspaces in the Midwest, and holding soldering workshops at them. They started their journey a week ago in Canada, and I joined up with them on Sunday in Detroit. I&#8217;m planning a more in-depth series of blog posts for Make, but for now here are the pictures from the first workshops, and our schedule:</p>
<p><strong>OCD</strong> (Detroit, MI): workshop on 8-August<br />
<strong>Mt. Elliot Makerspace</strong> (Detroit, MI): workshop on 9-August<br />
<strong>i3Detroit</strong> (Detroit, MI): workshop on 10-August<br />
<strong>A2 MechShop</strong> (Ann Arbor, MI): visit on 11-August<br />
<strong>AHA</strong> (Ann Arbor, MI): workshop on 12-August<br />
<strong>LVL1/Actors Theatre</strong> (Louisville, KY): demo on 13-August<br />
<strong>LVL1</strong> (Louisville, KY): workshop on 14-August<br />
<strong>Hive13</strong> (Cincinnati, OH): presentation on 17-August<br />
<strong>Hive13</strong> (Cincinnati, OH): workshop on 18-August<br />
<strong>BloomingLabs</strong> (Bloomington, IN): workshop on 19-August<br />
<strong>Arch Reactor</strong> (St. Louis, MO): workshop on 20-August<br />
<strong>KC Mini Maker Faire / CCCKC</strong> (Kansas City, MO): Hardware Hacking Area at Faire on 22-August<br />
<strong>Quad Cities Co-Lab Hackerspace</strong> (Quad Cities, IA/IL): workshop on 24-August<br />
<strong>PS:1</strong> (Chicago, IL): workshop on 25-August<br />
<strong>Madison BarCamp</strong> (Madison, WI): talk on hackerspaces on 28-August<br />
<strong>Sector67</strong> (Madison, WI): workshop on 29-August</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/08/midwest-maker-tour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
