<?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>Håkon Nessjøen &#187; pic</title>
	<atom:link href="http://lunatic.no/category/pic/feed/" rel="self" type="application/rss+xml" />
	<link>http://lunatic.no</link>
	<description>Just another life hacker</description>
	<lastBuildDate>Tue, 06 Dec 2011 22:39:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Big timecode display</title>
		<link>http://lunatic.no/2009/10/big-timecode-display-2/</link>
		<comments>http://lunatic.no/2009/10/big-timecode-display-2/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 23:18:49 +0000</pubDate>
		<dc:creator>Håkon Nessjøen</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[hobby]]></category>
		<category><![CDATA[jackd]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[timecode]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2009/10/big-timecode-display-2/"></g:plusone></div>
So, in the last blog entry I told you about the perl DMX backend that we are doing for the party project of ours.We have concluded that we will have a bitchin&#8217; intro show. And it will be timecode controlled. Every little audio / DMX / Video effect will be timed to the millisecond.To do [...]]]></description>
			<content:encoded><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2009/10/big-timecode-display-2/"></g:plusone></div>
<p>So, in the last blog entry I told you about the perl DMX backend that we are doing for the party project of ours.<br/><br/>We have concluded that we will have a bitchin&#8217; intro show. And it will be timecode controlled. Every little audio / DMX / Video effect will be timed to the millisecond.<br/><br/>To do this, we have (for now) concluded that we will use Ardour as the audio platform, and use jackd as the timecode server.<br/><br/>The nice part about this, is that it&#8217;s very easy to code a jack client that fetches the timecode in realtime, and then transmit it via UDP to our external timecode display. And thats where this blog post comes in place; we are creating a cool 8 digit 7-segment display to display our timecode.<br/><br/><span class='imgcenter'><img alt='' src='http://files.myopera.com/lunatic/blog/bilde%284%29.jpg' /></span><br/>William got 8 of these modules from Kay, who agian bought them for almost nothing at eBay. :D (in Norway they cost about $25 each at the time of writing)<br/><br/>Anyways. As you see in the picture, william has glued the 8 digits together, wich we will put inside a box, and wire up with some pic18f4520 and some ENC28J60 for ethernet connectivity. Yes, the module will be stand-alone, only connected to ethernet, and display the current timestamp/timecode in Ardour/our DMX system.<br/><br/>Do we _really_ need it? no. Is it really cool? yes.<br/><br/>So, so far we have finally gotten the box for the device. It&#8217;s acctually a image frame, with an exceptionally deep frame on the backside to contain the whole shebang.<br/><br/>Here are some more &#8220;under construction&#8221; photos:<br/><span class='imgcenter'><img alt='' src='http://files.myopera.com/lunatic/blog/28092009056.jpg' /></span> <span class='imgcenter'><img alt='' src='http://files.myopera.com/lunatic/blog/28092009053.jpg' /></span><br/><br/>In the first photo you can (almost) see the PIC18F4520 on a vero board, with a connected prototype board with the ENC28J60 chip, which works perfectly and successfully outputs data to the (soon to be connected) displays when it receives timecode UDP data on port 1337 ;P<br/><br/>This project has not been the easiest, even though the concept is simple. I&#8217;m not the greatest engineer in regards to analog electronics. The problem is that the 7segment displays needs 7.2v, and uses common anode. This means that I cannot use the displays directly from the PIC processor. So i went on using a ULN2803A to drive the display. This solves the &#8220;common anode&#8221; problem. Now on to solving the 7.2v problem. I have as I said, not very much to say in the analog electronics world. So I went on, and found the first PNP transistor I could find. Kay was kind enough to donate them to us.<br/><br/>He had a bunch of 2N3906 transistors, wich seemed to be &#8220;workable&#8221;. So i set them up on a breadboard and after some fidling with resistors and pulling up the signal, to let the PIC pull it down, to enable the flow trough collector and emitter. This seemed to work great, so I soldered the whole shebang together.<br/><br/>Everything works great now, except that the display &#8220;fluctuates&#8221;. Seems like either the 5v regulator is too weak (it gets pretty hot, but I can&#8217;t check it, because my multimeter doesn&#8217;t want to measure current), or the transistors are a bit too sensitive. Sometimes, when there is traffic on the network the display fluctuates when the ethernet-leds light up. So something is not at it&#8217;s fully potential yet. But I&#8217;ll measure a bit when I get a working multimeter.<br/><br/>So here are the latest images(only thing missing is the 4 dots at the bottom):<br/><span class='imgcenter'><img alt='' src='http://files.myopera.com/lunatic/blog/bilde%286%29.jpg' /></span> <span class='imgcenter'><img alt='' src='http://files.myopera.com/lunatic/blog/bilde%287%29.jpg' /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://lunatic.no/2009/10/big-timecode-display-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LEDDisplay games</title>
		<link>http://lunatic.no/2006/12/leddisplay-games-2/</link>
		<comments>http://lunatic.no/2006/12/leddisplay-games-2/#comments</comments>
		<pubDate>Sat, 02 Dec 2006 23:55:18 +0000</pubDate>
		<dc:creator>Håkon Nessjøen</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[hobby]]></category>
		<category><![CDATA[led display]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[pic microcontroller]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2006/12/leddisplay-games-2/"></g:plusone></div>
So.. We can&#8217;t have a &#8220;screen&#8221; without pong or snake, can we? When I completed the LED Displays abillity to be controlled from the computer via RS232, I wrote a nifty little module in Perl, which I called: Acme::LEDDisplay.With this module I am able to use the display just as a.. well&#8230; display :) But [...]]]></description>
			<content:encoded><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2006/12/leddisplay-games-2/"></g:plusone></div>
<div>
<div id="excerpt">So.. We can&#8217;t have a &#8220;screen&#8221; without pong or snake, can we?</div>
</div>
<div>When I completed the LED Displays abillity to be controlled from the computer via RS232, I wrote a nifty little module in Perl, which I called: Acme::LEDDisplay.With this module I am able to use the display just as a.. well&#8230; display :)<br />
But &#8217;till today, I haven&#8217;t made anything really cool. Just some small things like live Network-graph and live IRC log ;p</p>
<p>But today I wrote two games for it, and I&#8217;m pretty pleased about the result :)</p>
<p>The new scripts for today are Snake/Nibbles, Pong, and a little meaningless bouncy-script.</p>
<p><strong>Nibbles</strong><br />
<img src="http://files.myopera.com/lunatic/blog/ATT00299.jpg" alt="" /><br />
Source:<br />
<a href="http://files.myopera.com/lunatic/blog/nibbles.pl" target="_blank">nibbles.pl</a><br />
Video:<br />
<a href="http://files.myopera.com/lunatic/blog/MOV00332.avi" target="_blank">MOV00332.avi</a></p>
<p><strong>Pong</strong><br />
<img src="http://files.myopera.com/lunatic/blog/ATT00293.jpg" alt="" /><br />
Source:<br />
<a href="http://files.myopera.com/lunatic/blog/pong.pl" target="_blank">pong.pl</a><br />
Video:<br />
<a href="http://files.myopera.com/lunatic/blog/MOV00334.avi" target="_blank">MOV00334.avi</a></p>
<p><strong>Meaningless script</strong><br />
Also made this little ball-bouncing script, which pong is built upon. It uses pretty much the same &#8220;ball&#8221; module. You can start it with as many balls you want. And it bounces them randomly about.</p>
</div>
<div>Source:<br />
<a href="http://files.myopera.com/lunatic/blog/bballs.pl" target="_blank">bballs.pl</a><br />
Video:<br />
<a href="http://files.myopera.com/lunatic/blog/MOV00331.avi" target="_blank">MOV00331.avi</a></div>
]]></content:encoded>
			<wfw:commentRss>http://lunatic.no/2006/12/leddisplay-games-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://files.myopera.com/lunatic/blog/MOV00332.avi" length="972462" type="video/avi" />
		</item>
		<item>
		<title>LEDDisplay / BlinkenLed</title>
		<link>http://lunatic.no/2006/11/leddisplay-blinkenled-2/</link>
		<comments>http://lunatic.no/2006/11/leddisplay-blinkenled-2/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 05:21:29 +0000</pubDate>
		<dc:creator>Håkon Nessjøen</dc:creator>
				<category><![CDATA[blikenlights]]></category>
		<category><![CDATA[blinkenled]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[hobby]]></category>
		<category><![CDATA[led display]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[pic microcontroller]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2006/11/leddisplay-blinkenled-2/"></g:plusone></div>
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2026</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2026</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2398</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument to implode must be an array. in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3351</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3374</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3374</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3415</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3467</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3467</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3612</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3612</b><br />
My newest project; LED Display. Youtube video of it The idea came from germany, where the group &#8220;CCC&#8221; or Chaos Computer Club, created a matrix of lights in the &#8220;Haus des Lehrers&#8221; building at Alexanderplatz in Berlin. They installed computer controlled lights in 144 windows spanned over 8 floors (18 windows per floor). This was [...]]]></description>
			<content:encoded><![CDATA[<div style="display:inline;float:right;margin-left:1em"><g:plusone href="http://lunatic.no/2006/11/leddisplay-blinkenled-2/"></g:plusone></div>
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2026</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2026</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>2398</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument to implode must be an array. in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3351</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3374</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3374</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3415</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3467</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3467</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3612</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/lunatic.no/html/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on line <b>3612</b><br />
<p><span style="font-size: medium;">My newest project; LED Display.</span><br />
<a href="http://www.youtube.com/watch?v=GHMd2JFMvOw" target="_blank"><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/ATT00293.jpg" alt="" /></span></a><br />
<a href="http://www.youtube.com/watch?v=GHMd2JFMvOw" target="_blank">Youtube video of it</a></p>
<p>The idea came from germany, where the group &#8220;CCC&#8221; or Chaos Computer Club, created a matrix of lights in the &#8220;Haus des Lehrers&#8221; building at Alexanderplatz in Berlin. They installed computer controlled lights in 144 windows spanned over 8 floors (18 windows per floor). This was done first in 2001. You can look at their webpage at <a href="http://blinkenlights.de/" target="_blank">BlinkenLights.de</a>.</p>
<p>If you search for Blinkenlights on video.google.com or youtube you will find a really interesting documentary about the Blinkenlights project. I saw this video a few years ago, but when I saw it again now recently, I ignited on all my sparks. I had to make my own small scale version.</p>
<p>So I surfed the web, and I found, amongst others, <a href="http://www.jalcds.de/blinkenleds/" target="_blank">BlinkenLEDs</a>. These guys had done almost exactly what I wanted to do. I saw that they were using a 4094 Bit-shift register. I myself would have used a 74xxx series chip, but since they had done it perfectly with this chip, and since it looked like it worked perfectly even without resistors for each LED, I incorporated the 4094 chip in my plans.</p>
<p>My plan differs from theirs in two ways. I wanted mine to be able to run without a computer connected. For this I planned using the PIC16F628. Someone might wonder why I wouldn&#8217;t use the cheaper &#8220;less cmos&#8221; version PIC16F84. But the answer is also the answer to the other way my project differs. I wanted to use the serial port, instead of the LPT(read: printer) port. And the PIC16F628 has hardware USART capability, which makes RS232 connection simple.</p>
<p>The part-list for mye circuit is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">  <span style="">1</span>     PIC16F628
  <span style="">1</span>     <span style="">18</span>-PIN socket <span class="br0">&#40;</span>for the PIC<span class="br0">&#41;</span>
  <span style="">1</span>     MAX232
  <span style="">1</span>     <span style="">95128</span> SPI controlled EEPROM <span class="br0">&#40;</span>128KB memory<span class="br0">&#41;</span>
  <span style="">1</span>     20MHz Crystal for the PIC
  <span style="">1</span>     33uF electrolyte capacitor <span class="br0">&#40;</span>noise reduction for PIC<span class="br0">&#41;</span>
  <span style="">2</span>     22pF capacitors for 20Mhz crystal
  <span style="">2</span>     Veroboards <span class="br0">&#40;</span>prototyping boards<span class="br0">&#41;</span>
  3M    Flat cable
  <span style="">4</span>     1uF electrolyte capacitors <span class="br0">&#40;</span>for the MAX232<span class="br0">&#41;</span>
  <span style="">18</span>    <span style="">4094</span> Bit shift registers
  <span style="">144</span>   Red 3mm Leds <span class="br0">&#40;</span>I've got <span style="">4000</span> spare :P<span class="br0">&#41;</span>
  misc  Wires</pre></div></div>

<p>The circuit was planned live inside my head ;) I have regretted this a bit as the project evolved, but all in all, I&#8217;m pretty happy/proud about the result.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image1.jpg" alt="" /></span></p>
<p>Here you can see a picture of the controller-card when I had completed the wiring of 3 bit-shift registers, the PIC16F628 and the MAX232. I were planning on having two rows of bitshift registers filling the whole left side of the board, spacing just enough to have 8 wires up to the LED board from each register.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image2.jpg" alt="" /></span></p>
<p>Here you see how I wired the first 4 bit-shift registers. I found out later, that I wanted the first register to be on the next row. Even though here you can see that I have connected the first register on this &#8220;second row&#8221; to the PIC16F628 processor. If you are really observant, you can tell that I have changed my mind a few times on the wiring of the bottommost row ;P<br />
It also prooved later that I should have thought it over just one more time. Because here lies the root of all evil! I wired up all the STROBE pins to +5v, and wired together all the OUTPUT ENABLE pins, to one of the ports of the PIC processor. This was not what I meant to do. Because of this, my display will flicker a bit each time it updates the screen. But since it is a 20MHz processor, it&#8217;s hardly noticable.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image3.jpg" alt="" /></span></p>
<p>This is a picture of all the 18 Bit-shift registers wired up.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image4.jpg" alt="" /></span></p>
<p>This is all the registers wired up. You can see I have moved the control-cable from the processor to the leftmost registers. I tested the circuit with a program on the processor that lit one row by one, and all of them worked at the first try! :D</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image5.jpg" alt="" /></span></p>
<p>It was then over to the LED card. Here I have drilled out 144 holes. Pretty boring work I can tell you&#8230;. You see that I have wired the ground from the 9 first LEDs.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image6.jpg" alt="" /></span></p>
<p>This is how it looks when all 144 LEDs are connected. This took very long time, especially afther the first few rows. Since my friend had to leave, and so I was two hands short. But I got it done at the end. I wish this board was pre-tinned like the controller-vero board, since this made it even harder to solder the LEDS with only my own two hands.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image7.jpg" alt="" /></span></p>
<p>Then I started wiring up the leds to the shift registers. I am glad that I saw how terrible the wiring looked at the projects at BlinkenLEDS. So that I bought flat cable for my project. I&#8217;m pretty satisfied with how I wired up the leds to the flat cable. Even though it took quite a long time. After each new row, I powered up the circuit to check if there were any &#8220;dead pixels&#8221;. There were a few (read: totally 4-5), mostly since the board wasn&#8217;t pre-tinned, and I don&#8217;t have flux other than what the tin provided. But since I was in lack of hands, the flux evaporated before I got to actually solder the leds to the board.</p>
<p><span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image8.jpg" alt="" /></span></p>
<p>Here you see the board running a program that alternates between all the leds. The display works! It was time for celebration with a &#8220;blm&#8221; movie from the BlinkenLights project. So I wrote a parser in perl that converted a .blm file to .c code for my PIC16F628.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ttl</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@arr</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@outarr</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$out</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;&gt;</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><span style="color: #009966; font-style: italic;">m/^@(\d+)$/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$ttl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">m/^[01]{18}$/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">push</span> <span style="color: #0000ff;">@arr</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">scalar</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@arr</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot; PORTB &amp;= ~SHOW; // Hide display<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$pos</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">..</span><span style="color: #cc66cc;">17</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ari</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">..</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">push</span> <span style="color: #0000ff;">@outarr</span><span style="color: #339933;">,</span> <span style="color: #000066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$ari</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$pos</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot; sendbyte(0b&quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@outarr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;);<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #0000ff;">@outarr</span> <span style="color: #339933;">=</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: #0000ff;">@arr</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot; PORTB |= SHOW; // Show display<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot; delay_ms($ttl);<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The result was a moving version of this:<br />
<span class="imgcenter"><img src="http://files.myopera.com/lunatic/blog/image9.jpg" alt="" /></span><br />
Source of the BLM file, and moving GIF of the animation can be found <a href="http://www.blinkenlights.de/gallery/speedit.en.html" target="_blank">here</a>.</p>
<p>I have now coded the RS232 support and I first modified the above code to send the animation directly to the display. And then I coded myself a perl module to control the display live. I called it &#8220;Acme::LEDDisplay&#8221; and using some quick hacks. I have support for pset (pixel set), pget (pixel get), line, circle and text.</p>
<p>With this I can create live output from just about everything. The sky is the limit :D</p>
<p>Here is a video sample of &#8220;<a href="http://www.blinkenlights.de/gallery/spin.en.html" target="_blank">spin.blm</a>&#8221; on my display: <a class="attach" href="http://files.myopera.com/lunatic/blog/MOV00315.avi" target="_blank">MOV00315.avi</a></p>
<p>The project is almost done. I have made it possible to send blm movies directly from the PC, and control the display in simple perlcode. But the &#8220;offline-playing&#8221; part is not done. I had a few problems getting the SPI&lt;-&gt;EEPROM communication to work, so I have ordered some more EEPROMs to check if the one I have is broken. I really hope that, because it would be fun to be able to upload a few &#8220;movies&#8221;, and let it run for itself on batterypower. Maybe show off a few christmas greetings for example ;)</p>
<p>I also might wire it to my recently bougt Bluetooth module, so I can control it without any wires whatsoever :)</p>
<p>If you want more info about how I wired things up, sourcecode, etc. Give me a reply!</p>
]]></content:encoded>
			<wfw:commentRss>http://lunatic.no/2006/11/leddisplay-blinkenled-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://files.myopera.com/lunatic/blog/MOV00315.avi" length="1773388" type="video/avi" />
		</item>
	</channel>
</rss>

