<?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>robotguy.net/Blog &#187; mazetrix</title>
	<atom:link href="http://robotguy.net/blog/index.php/category/mazetrix/feed/" rel="self" type="application/rss+xml" />
	<link>http://robotguy.net/blog</link>
	<description>Robotics &#038; Electronics gone bad</description>
	<lastBuildDate>Wed, 23 Jun 2010 02:44:04 +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>#mazetrix video 1</title>
		<link>http://robotguy.net/blog/2009/06/25/mazetrix-video-1/</link>
		<comments>http://robotguy.net/blog/2009/06/25/mazetrix-video-1/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 04:03:08 +0000</pubDate>
		<dc:creator>Robotguy</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mazetrix]]></category>

		<guid isPermaLink="false">http://robotguy.net/blog/?p=78</guid>
		<description><![CDATA[I spent about 4 hours programming last night trying to simulate the physics of a rolling ball on the AVR. I think it turned out pretty well: Here&#8217;s the timer interrupt that services the analog to digital converter and the multiplexing of the LEDs: ISR(TIMER2_OVF_vect){ static unsigned char activeLine=0; static unsigned char adcChannel=0; PORTC=0xFF; PORTA=0xFF; [...]]]></description>
			<content:encoded><![CDATA[<p>I spent about 4 hours programming last night trying to simulate the physics of a rolling ball on the AVR. I think it turned out pretty well:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="275" height="226" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/a1ueQ7cmRw4" /><embed type="application/x-shockwave-flash" width="275" height="226" src="http://www.youtube.com/v/a1ueQ7cmRw4"></embed></object></p>
<p>Here&#8217;s the timer interrupt that services the analog to digital converter and the multiplexing of the LEDs:</p>
<blockquote><p>ISR(TIMER2_OVF_vect){<br />
static unsigned char activeLine=0;<br />
static unsigned char adcChannel=0;<br />
PORTC=0xFF;<br />
PORTA=0xFF;<br />
selectLine(activeLine);<br />
PORTC=~green_display[activeLine];<br />
PORTA=~red_display[activeLine];<br />
activeLine++;<br />
if(activeLine&gt;7){<br />
activeLine=0;<br />
}<br />
switch(adcChannel){<br />
case 0: x_accel=(ADCH-x_flat)/10;<br />
if((x_loc&lt;500)&amp;&amp;(x_accel&lt;0)){ 					x_accel=0; 				} 				if((x_loc&gt;7500)&amp;&amp;(x_accel&gt;0)){<br />
x_accel=0;<br />
}<br />
x_vel=limit(x_vel+x_accel,-MAXVELOCITY,MAXVELOCITY);<br />
ADMUX=0xE1;<br />
adcChannel=1;<br />
break;<br />
case 1: y_accel=(y_flat-ADCH)/10;<br />
if((y_loc&lt;500)&amp;&amp;(y_accel&lt;0)){ 					y_accel=0; 				} 				if((y_loc&gt;7500)&amp;&amp;(y_accel&gt;0)){<br />
y_accel=0;<br />
}<br />
//if((abs(y_accel)&gt;1)||(abs(y_vel)&gt;20)){<br />
y_vel=limit(y_vel+y_accel,-MAXVELOCITY,MAXVELOCITY);<br />
//}else{<br />
//	y_vel=0;<br />
//}<br />
ADMUX=0xE2;<br />
adcChannel=2;<br />
break;<br />
case 2: z_accel=(ADCH-125);<br />
ADMUX=0xE0;<br />
adcChannel=0;<br />
break;<br />
default: adcChannel=0;<br />
}</p>
<p>}</p></blockquote>
<p>And the main loop:</p>
<blockquote><p>while(1){</p>
<p>if((abs(x_vel)&gt;STICTION)||(abs(y_vel)&gt;STICTION)){<br />
x_vel=(int)((ELASTICNUMERATOR*(long int)x_vel)/ELASTICDENOMINATOR);<br />
x_loc+=x_vel;<br />
y_vel=(int)((ELASTICNUMERATOR*(long int)y_vel)/ELASTICDENOMINATOR);<br />
y_loc+=y_vel;<br />
}<br />
if(x_loc&lt;0){ 			x_loc=-x_loc; 			x_vel=-x_vel; 		} 		if(x_loc&gt;7999){<br />
x_loc=7999;<br />
x_vel=-x_vel;<br />
}<br />
if(y_loc&lt;0){ 			y_loc=-y_loc; 			y_vel=-y_vel; 		} 		if(y_loc&gt;7999){<br />
y_loc=7999;<br />
y_vel=-y_vel;<br />
}<br />
x_pos=(unsigned char)(x_loc/1000);<br />
y_pos=(unsigned char)(y_loc/1000);<br />
plotBall(x_pos,y_pos);<br />
_delay_ms(50);</p>
<p>}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://robotguy.net/blog/2009/06/25/mazetrix-video-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mazetrix Update</title>
		<link>http://robotguy.net/blog/2009/06/22/mazetrix-update/</link>
		<comments>http://robotguy.net/blog/2009/06/22/mazetrix-update/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 02:01:14 +0000</pubDate>
		<dc:creator>Robotguy</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mazetrix]]></category>

		<guid isPermaLink="false">http://robotguy.net/blog/?p=73</guid>
		<description><![CDATA[I received the pcbs for Mazetrix and started the build. After 4 1/2 hours of troubleshooting I realized that I connected the SCK line to the wrong pin and finally managed to get AVR Studio to recognize the processor. Then I wrote enough code to verify the LEDs would all light up.  However I then [...]]]></description>
			<content:encoded><![CDATA[<p>I received the pcbs for Mazetrix and started the build. After 4 1/2 hours of troubleshooting I realized that I connected the SCK line to the wrong pin and finally managed to get AVR Studio to recognize the processor. Then I wrote enough code to verify the LEDs would all light up.  However I then started having problems with the firmware. Finally, during my 15 minute lunch today, I found the problem was the fuse settings in the ATMEGA128 (either 103 comaptibility mode or JTAG enabled).</p>
<p>I just added the 3-axis accelerometer, but haven&#8217;t soldered on the supporting components. Also I still need to add the Li-Po charge IC. I am currently using the STK500 both to power and program the board.</p>
<p>So without further ado, here are some pics&#8230;</p>
<div class="wp-caption alignnone" style="width: 260px"><a href="http://robotguy.net/mazetrix1.jpg"><img title="Mazetrix1" src="http://robotguy.net/tn_mazetrix1.jpg" alt="Mazetrix project" width="250" height="255" /></a><p class="wp-caption-text">Mazetrix project</p></div>
<div class="wp-caption alignnone" style="width: 260px"><a href="http://robotguy.net/mazetrix2.jpg"><img title="Mazetrix2" src="http://robotguy.net/tn_mazetrix2.jpg" alt="Mazetrix Bottom" width="250" height="255" /></a><p class="wp-caption-text">Mazetrix Bottom</p></div>
<div class="wp-caption alignnone" style="width: 340px"><a href="http://robotguy.net/mazetrix3.jpg"><img title="Mazetrix3" src="http://robotguy.net/mazetrix3.jpg" alt="Mazetrix Top" width="330" height="200" /></a><p class="wp-caption-text">Mazetrix Top</p></div>
]]></content:encoded>
			<wfw:commentRss>http://robotguy.net/blog/2009/06/22/mazetrix-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to the Mazetrix</title>
		<link>http://robotguy.net/blog/2009/06/17/welcome-to-the-mazetrix/</link>
		<comments>http://robotguy.net/blog/2009/06/17/welcome-to-the-mazetrix/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 04:55:24 +0000</pubDate>
		<dc:creator>Robotguy</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mazetrix]]></category>

		<guid isPermaLink="false">http://robotguy.net/blog/?p=64</guid>
		<description><![CDATA[So, I just got an email from BatchPCB that my board has been shipped, so it looks like I&#8217;m switching gears again. My board is for a project based on the Tiletoy, and incidentally not unlike the Space Invaders Button, the Awesome and 64Pixels. Many moons ago I managed to score several 8&#215;64 Red-Green matrix [...]]]></description>
			<content:encoded><![CDATA[<p>So, I just got an email from BatchPCB that my board has been shipped, so it looks like I&#8217;m switching gears again.</p>
<p>My board is for a project based on the <a title="Tiletoy" href="http://www.tiletoy.org/" target="_blank">Tiletoy</a>, and incidentally not unlike the <a title="Space Invaders Button" href="http://interactive-matter.org/2009/04/space-invaders-button/" target="_blank">Space Invaders Button</a>, the <a title="Awesome" href="http://bringtheawesome.tumblr.com/page/1" target="_blank">Awesome</a> and <a title="64Pixels" href="http://tinkerlog.com/2009/03/21/64pixels-are-enough/" target="_blank">64Pixels</a>.</p>
<p>Many moons ago I managed to score several 8&#215;64 Red-Green matrix displays salvaged, evidently, from a casino display. Even though I had managed to reverse engineer them and figure out how to display nifty messages, they were just too large and too <a title="COTS" href="http://en.wikipedia.org/wiki/Commercial_off-the-shelf" target="_blank">COTS</a> for me. I removed the 8&#215;8 LED matrices (matrixes?) and designed a small board to run them. The display is run directly from an ATMega128, using a half-H bridge on each column so I can <a title="LEDSensor" href="http://cs.nyu.edu/~jhan/ledtouch/index.html" target="_blank">use the entire matrix as a sensor</a>. Additionally, I have added a <a title="Accelerometer" href="http://www.sparkfun.com/commerce/product_info.php?products_id=308" target="_blank">MMA7260 triple axis accelerometer</a>. Last but not least is an IR LED pointed in each of the cardinal directions, also connected to be<a title="LEDComms" href="http://www.merl.com/papers/docs/TR2003-35.pdf" target="_blank"> used as an input and an output, for communicating to neighbor modules</a>(PDF link).</p>
<p>The ultimate goal is to create tiles with a red maze and a green &#8220;ball&#8221; than you can manipulate by tilting, just like the good old <a title="labyrinth" href="http://www.amazon.com/Brio-34000-Labyrinth/dp/B000XQ4VE2/" target="_blank">labyrinth game</a>. When you get to the edge of a tile, you can connect another, which will attach magnetically, and the maze will continue on the new tile.</p>
<p>I&#8217;ll add more updates when I start building.</p>
<p>Here&#8217;s a few images to satisfy the curious:</p>
<div class="wp-caption alignnone" style="width: 260px"><a href="http://robotguy.net/Mazetrix-schematic.jpg"><img title="schematic" src="http://robotguy.net/tn_Mazetrix-schematic.jpg" alt="schematic" width="250" height="135" /></a><p class="wp-caption-text">schematic</p></div>
<div class="wp-caption alignnone" style="width: 138px"><a href="http://robotguy.net/mazetrix-top.png"><img title="Mazetrix Layout" src="http://robotguy.net/tn_mazetrix-top.png" alt="Mazetrix Layout" width="128" height="128" /></a><p class="wp-caption-text">Mazetrix Layout</p></div>
]]></content:encoded>
			<wfw:commentRss>http://robotguy.net/blog/2009/06/17/welcome-to-the-mazetrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
