<?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>Creating With Code</title>
	<atom:link href="http://creatingwithcode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://creatingwithcode.com</link>
	<description>A blog by Robert (Marty) McGuire</description>
	<lastBuildDate>Tue, 17 Aug 2010 18:38:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Thingiverse Embed Plugin for WordPress</title>
		<link>http://creatingwithcode.com/software/thingiverse-embed-wordpress/</link>
		<comments>http://creatingwithcode.com/software/thingiverse-embed-wordpress/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 03:10:01 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[thingiverse]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=264</guid>
		<description><![CDATA[For a while now, I&#8217;ve wanted to embed an RSS feed of the latest stuff I&#8217;ve printed from Thingiverse on MakerBot 131&#8242;s page. To kick things off, I asked Zach to implement an RSS feed of the Thing&#8217;s I&#8217;ve Made page on Thingiverse. It&#8217;s been awhile, but I&#8217;ve finally gotten around to creating a WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now, I&#8217;ve wanted to embed an RSS feed of the latest stuff I&#8217;ve printed from <a href="http://www.thingiverse.com/">Thingiverse</a> on <a href="/makerbot_131/">MakerBot 131&#8242;s page</a>. To kick things off, I <a href="http://groups.google.com/group/thingiverse/browse_thread/thread/c4336a60935b31e0/9018cd40545d0645?lnk=gst">asked Zach to implement an RSS feed</a> of the <a href="http://www.thingiverse.com/Schmarty/made">Thing&#8217;s I&#8217;ve Made page</a> on Thingiverse.</p>
<p>It&#8217;s been awhile, but I&#8217;ve finally gotten around to creating a WordPress plugin that I&#8217;m calling <a href="http://wordpress.org/extend/plugins/thingiverse-embed/">Thingiverse Embed</a>.</p>
<h3>Usage</h3>
<p>The plugin has two features.  First, you can embed a little &#8220;wallet-sized&#8221; view of a Thing into an individual blog post or page, with the Thing&#8217;s title, creator, image, description, and links back to Thingiverse with a simple shortcode:</p>
<p><code>[thingiverse thing_id="1046"]</code></p>
<p>Becomes:</p>
<div class="thingiverse-thing" id="thing-1046">
<div class="thingiverse-thing-data">
<div class="thing-left">
<div class="thing-title"><a href="http://www.thingiverse.com/thing:1046">Whistle</a> by <a href="http://www.thingiverse.com/Zaggo">Zaggo</a></div>
<a href="http://www.thingiverse.com/thing:1046"><img class="thing-image" src="http://thingiverse_beta.s3.amazonaws.com/renders/d4/98/e7/79/1c/3947992182_48a3da68c3_o_preview_medium.jpg" /></a>
</div>
<div class="thing-description">
<i>Better Living with MakerBot, Episode 2</i><br>
You probably all know this situation: <br>
You're supposed to ref a soccer game in less than 1/2 an hour and you cannot find your whistle. You're screwed!<br><br>
But from now on you're out of trouble: Fire up your trusty MakerBot and print a new whistle in 26 minutes!<br><br>
This object prints the pea right inside the whistle. Since the pea is connected to the rest of the object only at one tiny point, it's quite easy to break it loose after printing with a small screw driver or tweezers.<br><br>
I probably pushing luck a little bit with bridging the top layer. So far I printed the whistle twice without problems.<br><br>
As always, I added the object as .obj file (wavefront), which can be imported into AOI and Blender.<br><br>
The gcode file is the one I used to print the whistle on the image. The gcode file contains an experimental raft with additional "blobs" on the second (interface) layer.<br>
You might want to generate your own gcode file with skeinforge settings, tested with your MakerBot. Be sure to setup Skeinforge to create an (almost) watertight object, since the whistle won't whistle if it's full of holes... <br><br><b>[Update]</b><br>
I added a second version of the whistle. "Whistle_v2" is an attempt to fine tune the object a little bit. My brother (he's a pipe organ builder) gave me some tips how to optimize the whistles mouth. Whistle v2 should start whistle with less airflow than v1 and thus be (somewhat) less loud. I also downsized the pea a little bit and changed the shape of the lanyard loop.<br><br>
Whistle v1 is still available for reference and also since it's more "tested"...<br><br><small>Since you blow the whistle with your mouth, be aware of possible problems concerning "food safety" of printed plastic. See the blog post "For foodies out there" ( <a href="http://blog.thingiverse.com/2009/09/13/for-foodies-out-there/" target="_blank" rel="nofollow">blog.thingiverse.com/2009/09/13/for-foodies-out-there/</a> ) for more information.</small></div>
</div>
<div class="thingiverse-thing-meta">
<a href="http://www.thingiverse.com/thing:1046">This thing</a> brought to you by <a href="http://www.thingiverse.com/"><img src="http://creatingwithcode.com/wp-content/plugins/thingiverse-embed/thingiverse_logo.png" alt="Thingiverse.com" title="Thingiverse.com" /></a>
</div>
</div>

<p>The plugin also includes a Thingiverse Stream widget, for embedding streams like &#8220;Things I&#8217;ve Made&#8221; as a simple sidebar widget.  It just needs to be configured with the title, the type of stream you want to use, the Thingiverse username (for certain streams), and the maximum number of Things to display.</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/08/thingiverse_sidebar_config.png"><img class="alignnone size-full wp-image-285" style="border: 1px solid black;" title="Thingiverse Stream config and example" src="http://creatingwithcode.com/wp-content/uploads/2010/08/thingiverse_sidebar_config.png" alt="" width="520" height="498" /></a></p>
<p>You can see this example on the page for <a href="/makerbot_131/">MakerBot 131</a>.</p>
<h3>Installation</h3>
<p>You can download the latest version of the <a href="http://wordpress.org/extend/plugins/thingiverse-embed/">Thingiverse Embed plugin from the WordPress Plugins directory</a>:</p>
<p>Or you can <a href="http://github.com/downloads/martymcguire/wp-thingiverse-embed/thingiverse-embed-0.1.zip">download thingiverse-embed-0.1 here</a>.</p>
<p>To install it, unzip the archive, copy the <code>thingiverse-embed</code> directory into your WordPress install&#8217;s plugins directory (usually <code>/wp-content/plugins</code>), and activate the plugin.</p>
<p>You&#8217;ll probably want to check out the <code>thingiverse-embed/readme.txt</code> for more information about how to use the plugin.</p>
<p>In addition to the <a href="http://plugins.svn.wordpress.org/thingiverse-embed/">WordPress Plugins SVN repository</a>, you can also find the code for this plugin in the <a href="http://github.com/martymcguire/wp-thingiverse-embed">wp-thingiverse-embed</a> repository on GitHub, for your forking pleasure.</p>
<p>It&#8217;s been fun a fun weekend developing this plugin, as it&#8217;s my first WordPress plugin, and the first &#8220;serious&#8221; PHP I&#8217;ve written.  Of course, it is filled with nasty HTML parsing and XPath tricks, and could use lots of cleanup, so please give me feedback if you use it!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/software/thingiverse-embed-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Camera Pt. 4 &#8211; Updating ReplicatorG</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-4-repg/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-4-repg/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 19:53:01 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[g-code]]></category>
		<category><![CDATA[replicatorg]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=201</guid>
		<description><![CDATA[In the previous posts in this series, I hacked up a Canon camera to take pictures with an electronic trigger, built a cable to connect the camera to my MakerBot, and hacked the MakerBot&#8217;s firmware to enable it to trigger the camera in response to commands from the controlling computer. The final step was to [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous posts in this series, I <a href="/howto/makerbot-cam-1-chdk/">hacked up a Canon camera</a> to take pictures with an electronic trigger, <a href="/howto/makerbot-cam-2-wiring/">built a cable</a> to connect the camera to my MakerBot, and <a href="/howto/makerbot-cam-3-firmware/">hacked the MakerBot&#8217;s firmware</a> to enable it to trigger the camera in response to commands from the controlling computer.</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check31.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check31.png" alt="" title="MakerBot camera communications diagram, all done (except the PC)." width="513" height="139" class="alignnone size-full wp-image-212" /></a></p>
<p>The final step was to hack the desktop software that controls the MakerBot &#8211; ReplicatorG.</p>
<h3>What is ReplicatorG?</h3>
<p>From the <a href="http://replicat.org/">ReplicatorG website</a>:</p>
<blockquote><p>[ReplicatorG] is the software that will drive your CupCake CNC, RepRap machine, or generic CNC machine. You can give it a GCode or STL file to process, and it takes it from there. Its cross platform, easily installed, and is based on the familiar Arduino / Processing environments.</p></blockquote>
<p>For my purposes, ReplicatorG provides two things. First, RepG is a user interface for controlling the MakerBot hardware:</p>
<p><a href="http://www.flickr.com/photos/phooky/4604290256/sizes/o/"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/replicator_g_control_panel.png" alt="" title="RepG extruder control panel. Image by phooky, CC-BY-SA." width="426" height="437" class="alignnone size-full wp-image-218" /></a></p>
<p>Second, RepG reads <a href="http://en.wikipedia.org/wiki/G-code">G-code</a> files describing how to build an object, and transmits them to the MakerBot over the USB:</p>
<p><a href="http://www.flickr.com/photos/makerbot/4816221120/sizes/m/"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/repg_gcode.jpg" alt="" title="RepG G-code viewer. Image by makerbot, CC-BY." width="476" height="500" class="alignnone size-full wp-image-220" /></a></p>
<p>Of course, ReplicatorG is open source, and the code is <a href="http://github.com/makerbot/ReplicatorG">available on GitHub</a>!  So, it was simple to clone their repository and start hacking on it myself.</p>
<h3>Camera Control via ReplicatorG</h3>
<p>While it was relatively simple to update the extruder controller firmware to make it camera-aware, ReplicatorG is a bit more complicated.  My first goal was to hack a new &#8220;Camera&#8221; checkbox into the control panel.  Whenever the box was checked, the camera would take pictures. Whenever the box was unchecked, the camera would be idle.</p>
<p>You can find the code required for these changes in <a href="http://github.com/martymcguire/ReplicatorG/commit/6b967b4e7dd115a674c3e223d3abc7119ab44c1a">this commit on GitHub</a>, but I will try to briefly break them down here:</p>
<ul>
<li><strong>Define a new machine</strong>.  In the <code>machines.xml.dist</code> file, I defined an experimental MakerBot configuration named &#8220;EXPERIMENTAL &#8211; Cupcake CNC w/HBP and remote camera&#8221;.  It is essentially a copy of the typical MakerBot configuration with a heated build platform, but in the <code>&lt;tool&gt;</code> definition, I also added a <code>camera="true"</code> attribute.</li>
<li><strong>Update the tool model</strong>. In <code>ToolModel.java</code>, I added code to represent whether the tool has an attached camera, whether the camera is activated, and how to parse the <code>camera</code> attribute out of <code>machines.xml</code>.</li>
<li><strong>Update the machine driver model</strong>.  In <code>Driver.java</code>, <code>DriverBaseImplementation.java</code>, and <code>Sanguino3GDriver.java</code>, I added the definitions and implementations to <code>triggerCamera()</code> and <code>stopTriggeringCamera()</code>.  This is the code that actually sends the <code>TOGGLE_CAMERA</code> serial command to the extruder controller, which I also defined in <code>ToolCommandCode.java</code>.</li>
<li><strong>Update the control panel interface</strong>. In <code>ExtruderPanel.java</code>, I added the code to draw a new label and checkbox named &#8220;Camera&#8221;, if the machine is configured for a camera, and to respond to check/uncheck events by calling <code>triggerCamera()</code> or <code>stopTriggeringCamera()</code>.</li>
</ul>
<h3>Compiling and Running the new ReplicatorG</h3>
<p>Compiling ReplicatorG is pretty simple, so long as you have a reasonable JDK environment and have Ant on your path.  There are basically two steps:
<ol>
<li>Copy <code>machines.xml.dist</code> to <code>machines.xml</code>.</li>
<li>Run the proper <code>dist-linux.sh</code>, <code>dist-mac.sh</code>, or <code>dist-windows.sh</code>.</li>
</ol>
<p>ReplicatorG will be compiled and packaged up into the <code>dist/</code> directory in two forms: an installable package for the chosen platform, and an unpacked version that you can run directly.</p>
<p>Opening up my modified version of ReplicatorG, I selected the &#8220;EXPERIMENTAL &#8211; Cupcake CNC w/HBP and remote camera&#8221; profile from the <strong>Machine -> Driver</strong> menu, opened up the control panel, and was happy to see this:</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/control-panel-cam.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/control-panel-cam.png" alt="" title="RepG control panel... with camera trigger! It's down there, I swear." width="446" height="474" class="alignnone size-full wp-image-234" /></a></p>
<p>After hooking up my camera to the extruder controller&#8217;s <code>D9</code> port, and starting the <code>Remote Button</code> script on the camera, I was able to take pictures by quickly toggling the camera checkbox on and off.  I could also leave the checkbox activated to make the camera take pictures continuously.</p>
<h3>Automatic Triggering with G-codes</h3>
<p>Being able to trigger the camera by hand is all well and good, but my goal was to take pictures automatically at the end of every layer.  To do this, I needed to be able to embed camera trigger commands in the G-code for building each individual object.</p>
<p>Looking at the <a href="http://replicat.org/gcodes">ReplicatorG G-code docs</a>, and the (machine-specific) <a href="http://replicat.org/mcodes">M-code docs</a>, I chose two codes for working with the camera:
<ul>
<li><code>M150</code> &#8211; Trigger Camera</li>
<li><code>M151</code> &#8211; Stop Triggering Camera</li>
</ul>
<p>I may have to change these in the future, as the main ReplicatorG development team claim G- and M-codes for other features, but these work for now.</p>
<p>Modifying ReplicatorG to accept these M-codes (<a href="http://github.com/martymcguire/ReplicatorG/commit/876732b6a70bdaf4389476bfdf240d629ee50017">GitHub commit here</a>) was straightforward: update <code>GCodeParser.java</code> to recognize the codes, and call the appropriate <code>triggerCamera()</code> and <code>stopTriggeringCamera()</code> methods.</p>
<p>I could now construct a G-code file which, when &#8220;built&#8221; in ReplicatorG, would take a picture on demand:<br />
<code><br />
    M150 &nbsp;&nbsp;&nbsp;&nbsp;(trigger the camera)<br />
    G4 P700 &nbsp;(wait 0.7 seconds for the camera to activate)<br />
    M151 &nbsp;&nbsp;&nbsp;&nbsp;(stop triggering)<br />
    G4 P1300 (wait 1.3 seconds for the camera to finish)<br />
</code></p>
<p>Finally, it was time to edit up the G-code for the models I want to photograph.</p>
<p>Typically, G-code is generated by taking a 3D object in STL format and running it through the <a href="http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge">Skeinforge</a> tool.  Skeinforge is a set of Python scripts, which means it is not too difficult to insert your own code.</p>
<p>For now, however, I decided to make a simple hack using a Perl script I wrote called <code>add_camera_events.pl</code>.  It works by looking for <code>(&lt;/layer&gt;)</code> comments, which signal the end of a layer of printing, and inserts lines to:</p>
<ol>
<li>Move to a standard pose (<code>X=0, Y=-45</code>),</li>
<li>Trigger the camera and wait for it to finish, and</li>
<li>Move back to the original position</li>
</ol>
<p>You can find the source for this script in the <a href="http://gist.github.com/489805">add_camera_events.pl gist</a>.  The source for all of my changes to ReplicatorG are on GitHub, in the &#8220;schmarty-camera&#8221; branch of <a href="http://github.com/martymcguire/ReplicatorG/tree/schmarty-camera">my fork of ReplicatorG</a>.</p>
<p>And with that, the computer aspect of this system was finally done!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check4.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check4.png" alt="" title="Computer, motherboard, extruder controller, camera - all complete!" width="513" class="alignnone size-full wp-image-254" /></a></p>
<h3>Wrap Up</h3>
<p>Phew!  So far I&#8217;ve hacked a camera, wired it to the MakerBot, updated the MakerBot firmware to trigger it, updated ReplicatorG to trigger it, and written a script to update G-code files with camera triggers at the end of each layer.</p>
<p>So&#8230; does it work?  <a href="/makerbot/automatic-makerbot-time-lapse-photography/">You bet</a>!  Stay tuned for more examples and a breakdown video of this whole project in the final post in this series!</p>
<ul>
<li><a href="/howto/makerbot-cam-1-chdk/">Part 1: Remote control camera with CHDK</a></li>
<li><a href="/howto/makerbot-cam-2-wiring/">Part 2: Wiring it up!</a></li>
<li><a href="/howto/makerbot-cam-3-firmware/">Part 3: Updating the MakerBot Firmware</a></li>
<li>Part 4: Updating ReplicatorG [YOU ARE HERE]</li>
<li>Part 5: Printing with the Camera!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-4-repg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Space filling with 3D objects using Processing</title>
		<link>http://creatingwithcode.com/howto/space-filling-3d-processing/</link>
		<comments>http://creatingwithcode.com/howto/space-filling-3d-processing/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 02:15:09 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[space filling]]></category>
		<category><![CDATA[STL]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[thingiverse]]></category>
		<category><![CDATA[unlekkerLib]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=160</guid>
		<description><![CDATA[While I know I should be finishing my MakerBot time-lapse camera series, I took some time for another project to play with some Processing. The above image was rendered in Processing, in real time in just couple of minutes! Basically, I wanted to take a simple shape, defined by an SVG path, and fill it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/makerbotiverse3.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/makerbotiverse3.png" alt="" title="MakerBot &quot;M&quot; logo filled with Thingiverse objects." width="462" height="549" class="alignnone size-full wp-image-184" /></a></p>
<p>While I know I should be finishing my <a href="/howto/makerbot-cam-1-chdk/">MakerBot</a> <a href="/howto/makerbot-cam-2-wiring/">time-lapse</a> <a href="/howto/makerbot-cam-3-firmware/">camera</a> <a href="/makerbot/automatic-makerbot-time-lapse-photography/">series</a>, I took some time for another project to play with some <a href="http://processing.org/">Processing</a>.  The above image was rendered in Processing, in real time in just couple of minutes!</p>
<p>Basically, I wanted to take a simple shape, defined by an SVG path, and fill it with images of <a href="http://www.thingiverse.com/thing:1090">3D</a> <a href="http://www.thingiverse.com/thing:3465">objects</a> <a href="http://www.thingiverse.com/thing:3378">loaded</a> <a href="http://www.thingiverse.com/thing:1842">from</a> <a href="http://www.thingiverse.com/thing:1046">STL</a> <a href="http://www.thingiverse.com/thing:1224">files</a>.  Specifically, many wonderful MakerBot-printable objects from <a href="http://www.thingiverse.com/">Thingiverse</a>!</p>
<p>After some Googling around, I found out that this problem is basically a space-filling problem, similar to an excellent Processing sketch named <a href="http://www.openprocessing.org/visuals/?visualID=1811">Scattered Letters</a> by <a href="http://www.openprocessing.org/portal/?userID=1133">Algirdas Rascius</a>, but with a twist.</p>
<p>The basic algorithm is:
<ul>
<li>Load an SVG and render it to an off-screen buffer</li>
<li>Set <code>curr_size</code>, the size that STLs should be rendered, to <code>max_size</code></li>
<li>Choose a random STL model, give it a random orientation, and render it at the current size to an off-screen buffer</li>
<li>Try several times to place this model by giving it a random <code>x</code>,<code>y</code> position and checking it for a good fit:
<ul>
<li>Each non-background pixel of the model&#8217;s off-screen image should fit within the non-background pixels of the SVG&#8217;s off-screen image.</li>
<li>Each non-background pixel of the model&#8217;s off-screen image should NOT overlap with any non-background pixel of the main display.</li>
</ul>
</li>
<li>If a fitting position is found, render the model to the display.</li>
<li>Otherwise, shrink <code>curr_size</code> by a step and choose a new model.</li>
<li>If we drop below <code>min_size</code>, we should stop.</li>
</ul>
<p>You can find the <a href="http://github.com/martymcguire/ThingiverseCollage">code for my sketch, which I call ThingiverseCollage, on GitHub</a>.  To make it work, you&#8217;ll need to follow the installation instructions in the <a href="http://github.com/martymcguire/ThingiverseCollage/blob/master/README">README</a> to install my (very slightly) modified version of the <a href="http://workshop.evolutionzone.com/unlekkerlib/">unlekkerLib for STL loading and rendering</a>.  I modified it to allow rendering to a <code>PGraphics</code> object, since it originally only allowed rendering to the main <code>PApplet</code>.</p>
<p>A note on STL files: unlekkerLib only loads STL files in the binary format.  It chokes dramatically on ASCII STL files, such as those exported from <a href="http://openscad.org/">OpenSCAD</a>.  I was able to use <a href="http://www.pleasantsoftware.com/developer/pleasant3d/index.shtml">Zaggo&#8217;s excellent Pleasant3D</a> to load ASCII STLs and re-save them, which converts them to binary STLs.  As a bonus, Pleasant3D also allows you to orient objects in a way that will make them look most interesting when they are rendered down to 2D in the final image.</p>
<p>An example <code>M.svg</code>, as well as several objects from <a href="http://thingiverse.com/">Thingiverse</a> are included with the code to get started.  To use your own SVGs, I have had good luck using <a href="http://inkscape.org/">Inkscape</a> to draw or import shapes, and save them as the native &#8220;Inkscape SVG&#8221; or &#8220;Plain SVG&#8221; formats.  Some files might require hand-tweaking; for example, if the <code>width</code> and <code>height</code> header values are something like <code>"100%"</code> instead of a pixel value.</p>
<p>There is also some simple configuration in the sketch to allow the export of PDF files.  This is nice because the resulting PDF has full vector data, making it easily rescaled to any size you wish.  Unfortunately, the current PDF renderer for Processing renders <i>each triangle of each STL model</i> as a separate path, generating very complicated vector output, which tends to bring Inkscape to its knees.  I have had some luck with importing those files, rastering them out to PNG at a high resolution (e.g. 600 dpi), and using Inkscape&#8217;s &#8220;Trace Bitmap&#8221; functionality to re-vectorize them, though this requires some cleanup by hand.</p>
<p>Anyway, this has been a fun little diversion for me for the last couple of days.  I hope that you folks find it useful!  Post your awesome pictures in the comments, here!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/space-filling-3d-processing/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Camera Pt. 3 – Updating the MakerBot Firmware</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-3-firmware/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-3-firmware/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 00:43:34 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[3d printing]]></category>
		<category><![CDATA[firmware]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=144</guid>
		<description><![CDATA[In the previous post in this series, I figured out how to wire up my hacked Canon SD300 with CHDK. I chose to use the &#8220;D9&#8243; port on the Extruder controller board, thinking that should make the software as simple as setting pin 9 to &#8220;HIGH&#8221; for a brief time whenever I wanted to trigger [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous post in this series, I figured out how to <a href="/howto/makerbot-cam-2-wiring/">wire up</a> my <a href="/howto/makerbot-cam-1-chdk/">hacked Canon SD300 with CHDK</a>.  I chose to use the &#8220;D9&#8243; port on the <a href="http://reprap.org/bin/view/Main/Extruder_Controller_2_2#Servo_Headers">Extruder controller board</a>, thinking that should make the software as simple as setting pin 9 to &#8220;HIGH&#8221; for a brief time whenever I wanted to trigger the camera.</p>
<p>The next step was to update the software on the extruder controller so that it could activate (and deactivate) the camera, in response to commands from the motherboard.</p>
<h3><a style="text-decoration: none; color: #000" name="makerbot_comms">An aside on MakerBot communications</a></h3>
<p>The MakerBot electronics ecosystem is comprised of 3 parts: your computer, the <a href="http://reprap.org/wiki/Motherboard_1.2">MakerBot&#8217;s motherboard</a>, and the <a href="http://reprap.org/wiki/Extruder_Controller_2.2">extruder controller board</a>.  Your computer talks to the motherboard via a USB&lt;-&gt;TTL interface (such as this <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9718">FTDI cable from SparkFun</a>).  In turn, the motherboard communicates with the extruder using another serial protocol, <a href="http://en.wikipedia.org/wiki/EIA-485">RS-485</a>, over an ethernet cable.  Finally, the extruder triggers the camera via the custom cable I made in the <a href="/howto/makerbot-cam-2-wiring/">previous post</a>.</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag.png"><img class="size-full wp-image-196 alignnone" style="margin: 10px;" title="MakerBot Communications Diagram - Computer, motherboard, extruder controller, camera" src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag.png" alt="" width="500"/></a></p>
<p>The software for all three components is available on <a href="http://github.com/">the indomitable GitHub</a>.  The software for your computer is called <a href="http://replicat.org/">ReplicatorG</a>, and the source can be found in the <a href="http://github.com/makerbot/ReplicatorG">MakerBot ReplicatorG GitHub repository</a>.  I&#8217;ll talk more about ReplicatorG in the next post in this series.  For now, we want to focus on the <a href="http://github.com/makerbot/G3Firmware">MakerBot G3Firmware GitHub repository</a>, which contains the code for the motherboard (in the <a href="http://github.com/makerbot/G3Firmware/tree/master/SanguinoMaster/">SanguinoMaster</a> subdirectory), and for the extruder (in the <a href="http://github.com/makerbot/G3Firmware/tree/master/ArduinoSlaveExtruder/">ArduinoSlaveExtruder</a> directory).</p>
<p>Browsing through the code, we see that these components use their serial interfaces to send packets, where each command is represented by a number.  The commands for the motherboard can be found in the <a href="http://github.com/makerbot/G3Firmware/blob/master/SanguinoMaster/Commands.h">SanguinoMaster/Commands.h</a>, and those for the extruder can be found in <a href="http://github.com/makerbot/G3Firmware/blob/master/ArduinoSlaveExtruder/PacketProcessor.cpp">ArduinoSlaveExtruder/PacketProcessor.cpp</a>.</p>
<p>To send a message to the extruder &#8211; in this case, to activate or deactivate the camera &#8211; we must create a packet for the motherboard.  The <code>HOST_CMD_TOOL_QUERY</code> code allows us to send the motherboard a packet which it will then pass along to the extruder controller.</p>
<p>That&#8217;s great, because it means the motherboard part of this software hack is done!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check1.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check1.png" alt="" title="Motherboard - Check!" width="500" height="139" class="alignnone size-full wp-image-208" /></a></p>
<p>In fact, we&#8217;ve already hacked the camera, as well, so we&#8217;re halfway there!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check2.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check2.png" alt="" title="Camera: Check!" width="513" height="139" class="alignnone size-full wp-image-209" /></a></p>
<h3>Hacking a camera into the extruder controller</h3>
<p>Since the motherboard already does everything we need (passes along packets from the computer to the extruder controller), we only need to update the ArduinoSlaveExtruder code.</p>
<p>To get this to work, I ended up changing the following files:<br />
<a href="http://github.com/martymcguire/G3Firmware/commit/c7ff1ffb5f6004a37a0bcb2b5455403daac447d9#diff-0">ArduinoSlaveExtruder/Configuration.h.dist</a> &#8211; added in configuration options for enabling the camera and setting the pin on which to activate it.<br />
<a href="http://github.com/martymcguire/G3Firmware/commit/c7ff1ffb5f6004a37a0bcb2b5455403daac447d9#diff-2">ArduinoSlaveExtruder/Extruder.h</a> &#8211; added function definitions for turning on/off the camera.<br />
<a href="http://github.com/martymcguire/G3Firmware/commit/c7ff1ffb5f6004a37a0bcb2b5455403daac447d9#diff-1">ArduinoSlaveExtruder/Extruder.cpp</a> &#8211; actually implemented turning on/off the camera.<br />
<a href="http://github.com/martymcguire/G3Firmware/commit/c7ff1ffb5f6004a37a0bcb2b5455403daac447d9#diff-3">ArduinoSlaveExtruder/PacketProcessor.cpp</a> &#8211; implemented the serial command to toggle camera.</p>
<h3>Building and uploading</h3>
<p>If you followed the 4 links above, you&#8217;ll notice that they go to <a href="http://github.com/martymcguire/G3Firmware/">my own G3Firmware GitHub repository</a>.  You can download it yourself to play along by cloning the repository and checking out the <code>ECv2.3rc0-camera</code> branch.</p>
<p>To build the firmware and upload it to the extruder controller, we need some common development tools (make, in this case), and the <a href="http://arduino.cc/">Arduino</a> development environment.  With those things installed, we can compile everything by setting the <code>ARDUINO_HOME</code> environment variable to the path to our Arduino install&#8217;s java directory (e.g. on OS X this would be <code>/Applications/Arduino.app/Contents/Resources/Java/</code>), and simply run <code>make</code>.</p>
<p>Once the firmware has been compiled, we can upload it to the extruder controller by using the USB&lt;-&gt;TTL cable that usually connects the motherboard to our computer.  Plug the cable into the extruder controller, and run the <code>make upload</code> command.  You&#8217;ll need to make sure that <code>ARDUINO_HOME</code> is set, and you will probably need to alter the Makefile to specify the correct serial port, and maybe to update the call to <code>avrdude</code> to include the path to the Arduino avrdude config file.  You can see an example of that in <a href="http://github.com/martymcguire/G3Firmware/commit/0b9c9b09a084f3ad08ccbac7016e82ad3814a3c1">this commit</a>.</p>
<p>Once the firmware is uploaded to the extruder controller, the MakerBot is all set to take pictures!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check3.png"><img src="http://creatingwithcode.com/wp-content/uploads/2010/07/MB-comms-diag_check3.png" alt="" title="Extruder Controller - Check!" width="513" height="139" class="alignnone size-full wp-image-210" /></a></p>
<p>&#8230; Of course, we still have no way to <strong>tell</strong> the MakerBot to take a picture, so stay tuned for that information in the next update:</p>
<ul>
<li><a href="/howto/makerbot-cam-1-chdk/">Part 1: Remote control camera with CHDK</a></li>
<li><a href="/howto/makerbot-cam-2-wiring/">Part 2: Wiring it up!</a></li>
<li>Part 3: Updating the MakerBot Firmware [YOU ARE HERE]</li>
<li><a href="/howto/makerbot-cam-4-repg/">Part 4: Updating ReplicatorG</a></li>
<li>Part 5: Printing with the Camera!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-3-firmware/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Time-Lapse Photography!</title>
		<link>http://creatingwithcode.com/makerbot/automatic-makerbot-time-lapse-photography/</link>
		<comments>http://creatingwithcode.com/makerbot/automatic-makerbot-time-lapse-photography/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 03:41:54 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[3d printing]]></category>
		<category><![CDATA[time lapse]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=136</guid>
		<description><![CDATA[It works! Using a Canon SD300 with CHDK, and some firmware hacks, Makerbot #131 has learned how to make time-lapse videos of all of its prints! More details (and a how-to!) coming soon! And thanks to Thingiverse user Starno for the bottle opener model in the video.]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/kQns9DtSesE&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kQns9DtSesE&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>It works!</p>
<p>Using a Canon SD300 with <a href="http://chdk.wikia.com/wiki/CHDK">CHDK</a>, and some firmware hacks, Makerbot #131 has learned how to make time-lapse videos of all of its prints!</p>
<p>More details (and a how-to!) coming soon!  And thanks to <a href="http://www.thingiverse.com/">Thingiverse</a> user <a href="http://www.thingiverse.com/Starno">Starno</a> for the <a href="http://www.thingiverse.com/thing:1842">bottle opener model</a> in the video.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/makerbot/automatic-makerbot-time-lapse-photography/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MakerBot #131 Makes a Mendel!</title>
		<link>http://creatingwithcode.com/makerbot/makerbot-131-makes-a-mendel/</link>
		<comments>http://creatingwithcode.com/makerbot/makerbot-131-makes-a-mendel/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 00:05:18 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[google spreadsheets]]></category>
		<category><![CDATA[jsonp]]></category>
		<category><![CDATA[makerbot 131]]></category>
		<category><![CDATA[mendel]]></category>
		<category><![CDATA[reprap]]></category>
		<category><![CDATA[thingiverse]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=119</guid>
		<description><![CDATA[Like many MakerBot owners, I feel compelled to help spread desktop 3D printing throughout the world.  So, for the past several months, MakerBot #131 has been hard at work printing parts in 3D to make another 3D printer! The Mendel is the second (and current) design for the RepRap project, whose goal is to create [...]]]></description>
			<content:encoded><![CDATA[<p><code><a href="http://www.flickr.com/photos/cibomahto/4649260050/"><img class="alignnone" title="Mendel Parts, photo by Matt Mets" src="http://farm5.static.flickr.com/4019/4649260050_8514243bf4_b.jpg" alt="Image by Matt Mets" width="500" height="605" /></a></code></p>
<p>Like many <a href="http://makerbot.com/">MakerBot</a> owners, I feel compelled to help spread desktop 3D printing throughout the world.  So, for the past several months, <a href="http://creatingwithcode.com/makerbot_131/">MakerBot #131</a> has been hard at work printing parts in 3D to make another 3D printer!</p>
<p>The <a href="http://reprap.org/wiki/Mendel">Mendel</a> is the second (and current) design for the <a href="http://reprap.org/wiki/Main_Page">RepRap project</a>, whose goal is to create rapid-prototyping machines that can replicate themselves.  As an Open Source Hardware project, everything about the <a href="http://reprap.org/wiki/Subversion">Mendel&#8217;s design is available online</a> via Subversion, from the mechanical parts to the electronics schematics, to the source code for the device and its host machine.  Additionally, there is a <a href="http://forums.reprap.org/">fantastic community</a> of very smart people who are constantly improving the design, trying new things, and helping others get their RepRaps working!</p>
<p>While the Mendel requires various hardware bits such as motors, electronics, nuts and bolts, etc., its structure is about 51% 3D-printed parts.  This works out to about 98 individual pieces that need to be printed, and represents a huge number of printing hours.</p>
<p>To get started, I used a .zip file full of the 3D STL files for these parts that someone very nicely prepared and uploaded to the <a href="http://groups.google.com/group/makerbot/">MakerBot Operators group</a>.  These files were from the 1.0 release of Mendel, so some of them ended up being out of date, and a few had issues that made them unprintable.  Thankfully, another kind MakerBot operator uploaded a <a href="http://www.thingiverse.com/thing:1768">fully prepared set</a> to <a href="http://thingiverse.com/">Thingiverse</a>, so I could go there for a replacement whenever I found a part that wouldn&#8217;t print.</p>
<p style="text-align: left;">I started printing Mendel parts almost as soon as I got MakerBot #131 working.  Since I knew it was going to be a long process, I created a <a href="https://spreadsheets.google.com/ccc?key=0Ag-Fo1q90EdudDdTTndobmcyR2taaktXd3dTT2wyVkE#gid=0">spreadsheet to help me track and estimate</a> the time it would take to complete the build.  I also used some silly Javascript magic to display a progress bar on my MakerBot #131 page based on this spreadsheet data:</p>
<p style="text-align: center;"><a href="http://creatingwithcode.com/wp-content/uploads/2010/06/mendel_complete.png"><img class="size-full wp-image-122 aligncenter" style="border: 1px solid black;" title="100% Complete! So satisfying." src="http://creatingwithcode.com/wp-content/uploads/2010/06/mendel_complete.png" alt="" width="504" height="100" /></a></p>
<p style="text-align: left;">This hack was accomplished by building my own JSONP into some cells of the spreadsheet, and loading this content as Javascript using Google Spreadsheet&#8217;s plain text export capability.  The spreadsheet cells were set up like this:</p>
<p style="text-align: center;"><a href="http://creatingwithcode.com/wp-content/uploads/2010/06/mendel_jsonp.png"><img class="aligncenter size-full wp-image-123" style="border: 1px solid black;" title="Here be dragons:	update_mendel_progress('	=N47	'	);" src="http://creatingwithcode.com/wp-content/uploads/2010/06/mendel_jsonp.png" alt="" width="500" height="33" /></a></p>
<p style="text-align: left;">Here, column N47 contains the &#8220;completeness&#8221; of the Mendel as a value of 0.0 &#8211; 1.0 in terms of number of hours printed so far divided by the expected number of hours total.  This data could be used on an HTML page with an &#8220;update_mendel_progress&#8221; function by loading it with a script tag:</p>
<p style="text-align: left;"><code>&lt;script src="http://spreadsheets.google.com/pub?key=t7SNwhng2GkZjKWwwSOl2VA&amp;single=true&amp;gid=0&amp;range=B52:E52&amp;output=txt"&gt;&lt;/script&gt;</code></p>
<p style="text-align: left;">The range &#8220;B52:E52&#8243; are the cells in my spreadsheet containing the JSONP call, and the &#8220;output=txt&#8221; option returns the data as tab-separated data, which Javascript is happy to parse.  The update_mendel_progress method on that page parses the number that is passed in, looks for an HTML DIV element with an id of &#8220;mendel_progress&#8221;, updates it to be the appropriate width, and displays the percentage completion.</p>
<p style="text-align: left;">At any rate, after a lot of tweaking, many hair-raising moments, a required upgrade with the <a href="http://store.makerbot.com/cupcake-cnc/makerbot-cupcake-heated-build-platform-v2-0.html">MakerBot Heated Build Platform v2.0</a>, and hours and hours of printing, the parts were finally complete!  I gave them to <a href="http://cibomahto.com/">Matt Mets</a>, a member of <a href="http://hackpittsburgh.org/">HackPittsburgh</a>, and you can see the photos he took of the parts, above!</p>
<p style="text-align: left;">Despite some of the parts belonging to a slightly out-of-date design, Matt has been <a href="http://www.cibomahto.com/2010/06/mendel-progress/">making progress</a> on getting everything together!</p>
<p style="text-align: left;"><a href="http://www.cibomahto.com/2010/06/mendel-progress/"><img class="alignnone" title="Matt's Mendel Progress, photo by Matt Mets." src="http://www.cibomahto.com/wp-content/uploads/2010/06/DSC_7132.jpg" alt="" width="500" height="375" /></a></p>
<p style="text-align: left;">You can follow Matt&#8217;s progress on <a href="http://www.cibomahto.com/">his blog</a>.</p>
<p style="text-align: left;">I&#8217;m very happy to have finished off such a large project with MakerBot #131, and I have a lot of plans for it in the future, so be sure to watch this space for more updates!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/makerbot/makerbot-131-makes-a-mendel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Desktop Fabrication Presentation @ Dorkbot Pittsburgh</title>
		<link>http://creatingwithcode.com/howto/dorkbot-pgh-makerbot-presentatio/</link>
		<comments>http://creatingwithcode.com/howto/dorkbot-pgh-makerbot-presentatio/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 01:10:39 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[dorkbot]]></category>
		<category><![CDATA[fabrication]]></category>
		<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[pittsburgh]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=109</guid>
		<description><![CDATA[&#160; On Thursday, March 25th, I spoke about desktop fabrication and the MakerBot Cupcake CNC 3D printer at Dorkbot Pittsburgh. After some slides, I gave a printing demo with my Cupcake, Makerbot #131. You can find my slides above. I&#8217;ll post the video when it becomes available.]]></description>
			<content:encoded><![CDATA[<div style="width:425px" id="__ss_3590812"><object width="500" height="418"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=martymcguire-makerbot-2010-03-25-100329194817-phpapp01&#038;rel=0&#038;stripped_title=desktop-fabrication-marty-mcguire-dorkbot-pittsburgh-march-2010" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=martymcguire-makerbot-2010-03-25-100329194817-phpapp01&#038;rel=0&#038;stripped_title=desktop-fabrication-marty-mcguire-dorkbot-pittsburgh-march-2010" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="418"></embed></object></div>
<div>&nbsp;</div>
<p>On Thursday, March 25th, I spoke about desktop fabrication and the <a href="http://makerbot.com/">MakerBot Cupcake CNC</a> 3D printer at <a href="http://dorkbot.org/dorkbotpgh/">Dorkbot Pittsburgh</a>.  After some slides, I gave a printing demo with my Cupcake, <a href="/makerbot_131">Makerbot #131</a>.  You can find my slides above.  I&#8217;ll post the video when it becomes available.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/dorkbot-pgh-makerbot-presentatio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unboxing the Make: Electronics Components Pack 1</title>
		<link>http://creatingwithcode.com/electronics/unboxing-make-electronics-components-pack-1/</link>
		<comments>http://creatingwithcode.com/electronics/unboxing-make-electronics-components-pack-1/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 02:47:41 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[pack]]></category>
		<category><![CDATA[unboxing]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=104</guid>
		<description><![CDATA[Like many enthusiastic makers, I recently got my hands on a copy of the excellent Make: Electronics book from O&#8217;Reilly.  It&#8217;s an excellent bottom-up, experiment-based introduction to electronics, but sourcing all of the parts required to complete each experiment can be an adventure. Thankfully, the Maker Shed is now offering two components packs to help [...]]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/TGOL8WerVQw&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TGOL8WerVQw&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
<p>Like many enthusiastic makers, I recently got my hands on a copy of the excellent <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=9780596153748">Make: Electronics</a> book from O&#8217;Reilly.  It&#8217;s an excellent bottom-up, experiment-based introduction to electronics, but sourcing all of the parts required to complete each experiment can be an adventure.</p>
<p>Thankfully, the Maker Shed is now offering two <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MECP1">components</a> <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MECP2">packs</a> to help you work through the book without having to order from a half-dozen parts vendors!</p>
<p>Tonight at <a href="http://www.hackpittsburgh.org/">HackPittsburgh</a>, <a href="http://cibomahto.com/">Matt Mets</a> and I  made a little unboxing video for the first components pack, which you can see embedded above.  Let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/electronics/unboxing-make-electronics-components-pack-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Camera Pt. 2 &#8211; Wiring it up!</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 01:44:52 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[MakerBot]]></category>
		<category><![CDATA[makerbot 131]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=83</guid>
		<description><![CDATA[Recently (thanks to the Internet), I figured out how to remote control a digital camera over USB using CHDK. However, if I wanted my MakerBot to be able to automatically control that camera, I needed a way to wire it up! CHDK&#8217;s remote USB trigger functionality works by detecting when it receives power over USB.  [...]]]></description>
			<content:encoded><![CDATA[<p>Recently (thanks to the Internet), I figured out how to <a href="http://creatingwithcode.com/howto/makerbot-cam-1-chdk/">remote control a digital camera over USB using CHDK</a>. However, if I wanted my MakerBot to be able to automatically control that camera, I needed a way to wire it up!</p>
<p>CHDK&#8217;s remote USB trigger functionality works by detecting when it receives power over USB.  This happens when two wires inside the <a href="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Delectronics&amp;field-keywords=usb+mini+b">USB mini-B</a> cable are connected to power: the red wire gets 5 volts, and the black wire gets connected to ground.</p>
<p><a href="http://reprap.org/bin/view/Main/Extruder_Controller_2_2#Servo_Headers"><img class="alignright" style="margin-left: 5px; float: right" title="Free I/O pins 9 and 10 on the extruder controller board" src="http://farm4.static.flickr.com/3484/3457207368_f7f6af91c0.jpg" alt="" width="300" height="225" /></a>So, I chose to find somewhere on the MakerBot&#8217;s electronics to hook up these power and ground wires such that the MakerBot could control when the red wire receives 5V.  The MakerBot uses <a href="http://store.makerbot.com/electronics/assembled-electronics/generation-3-electronics-mostly-assembled.html">RepRap Generation 3 electronics</a>, and let me tell you, the <a href="http://dev.www.reprap.org/bin/view/Main/Generation3Electronics">gen 3 electronics documentation</a> is fantastic!  Unfortunately, the <a href="http://reprap.org/bin/view/Main/Motherboard_1_2">docs for the main motherboard</a> reveal that there are some <a href="http://reprap.org/bin/view/Main/Motherboard_1_2#I2C_Headers">free I2C headers</a> for connecting serial devices, but no free general I/O pins.</p>
<p>Luckily, the <a href="http://reprap.org/bin/view/Main/Extruder_Controller_2_2#Servo_Headers">extruder controller docs</a> show two free digital pins, conveniently broken out with 5V and ground connections next to them.  These are digital pins D9 and D10.  According to the docs, they are intended for hooking up servo motors, but they would absolutely work for my purposes!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/02/camera_cable.jpg"><img class="size-medium wp-image-88 alignleft" style="margin-right: 5px; float: left" title="Camera cable with ultra-fancy labeling" src="http://creatingwithcode.com/wp-content/uploads/2010/02/camera_cable-300x184.jpg" alt="" width="300" height="184" /></a>The layout for pins D9 and D10 goes (from left to right): I/O pin, 5V, ground.  Since I wanted the data pin itself to provide the 5V, I chose to make a cable using a 3-pin piece of female header, soldering the red wire connecting to the I/O pin (on the left) and the black wire connecting to the ground pin (on the right).  The center pin has no connection.  You can see my &#8220;super fancy&#8221; cable on the left.</p>
<p>I know this post isn&#8217;t particularly about code, so stay tuned for the next parts of this series:</p>
<ul>
<li><a href="/howto/makerbot-cam-1-chdk/">Part 1: Remote control camera with CHDK</a></li>
<li>Part 2: Wiring it up! [YOU ARE HERE]</li>
<li><a href="/howto/makerbot-cam-3-firmware/">Part 3: Updating the MakerBot Firmware</a></li>
<li><a href="/howto/makerbot-cam-4-repg/">Part 4: Updating ReplicatorG</a></li>
<li>Part 5: Updating Skeinforge</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Camera Pt. 1 &#8211; Remote control camera with CHDK</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:11:22 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[makerbot 131]]></category>
		<category><![CDATA[point-and-shoot]]></category>
		<category><![CDATA[sd300]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=64</guid>
		<description><![CDATA[One problem with making time-lapse videos of MakerBot prints is the fact that the MakerBot works by moving the build platform (and therefore the object being built) around in the XY plane, resulting in an unwatchable blur. It recently occurred to me that, since the MakerBot is such a hackable platform, I could probably make [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://camura.com/s/Be2"><img class="alignright" style="margin-left: 10px; margin-bottom: 2px; float: right;" title="SD300 running CHDK with Remote Control" src="http://static.camura.com/media/images/m/ddb3ff73f26e44cb02c79434d0fd1aed.jpg" alt="" width="240" height="180" /></a>One problem with making <a href="http://www.youtube.com/watch?v=ox_Ng9gDgVE">time-lapse videos</a> of <a href="http://www.youtube.com/watch?v=mcn8Hu8c7qU">MakerBot prints</a> is the fact that the MakerBot works by moving the build platform (and therefore the object being built) around in the XY plane, resulting in an unwatchable blur.</p>
<p>It recently occurred to me that, since the MakerBot is such a hackable platform, I could probably make nice time-lapse videos by taking a picture of each layer.  The idea is to have the MakerBot pose the object after each layer, and trigger a camera to take a snapshot.</p>
<p>When discussing this idea with fellow <a href="http://hackpittsburgh.org/">HackPittsburgh</a> member <a href="http://cibomahto.com/">Matt Mets</a>, he recommended I try out a Canon camera with the <a href="http://chdk.wikia.com/wiki/CHDK">Canon Hack Development Kit (CHDK)</a>.  Making a quick stop on eBay, I soon had an <a href="http://chdk.wikia.com/wiki/SD300">SD300</a> in my hands, ready to be hacked!</p>
<p>I started by <a href="http://chdk.wikia.com/wiki/FAQ#Q._How_can_I_get_the_original_firmware_version_number_of_my_camera.3F">figuring out which firmware my SD300 was running</a>, which told me which <a href="http://mighty-hoernsche.de/bins/ixus40_sd300-100k-0.9.9-872-full.zip">version of CHDK to download</a> for my camera&#8217;s particular model/firmware combo.  Using an SD card reader, I copied the contents of the CHDK zip file onto my camera&#8217;s SD card and followed the instructions to <a href="http://chdk.wikia.com/wiki/FAQ#Q._How_can_I_make_the_CHDK_program_load_automatically_at_startup.3F">make CHDK auto-load</a> when the camera starts up.  I also changed my <a href="http://chdk.wikia.com/wiki/CHDK_firmware_usage">CHDK firmware settings</a> to set &#8220;Disable LCD off&#8221; to &#8220;[Script]&#8220;, so the camera wouldn&#8217;t shut down on its own.</p>
<p>Once CHDK was loaded and configured, I followed the <a href="http://chdk.wikia.com/wiki/USB_Remote_Cable">USB Remote Cable instructions</a> from the CHDK wiki.  The basic idea is to set Enable Remote to on, and load a script that is ready to handle USB remote events.  The one on the wiki page didn&#8217;t work as-is for me, presumably because my camera has half-shoot (i.e. focus and charge flash) and full-shoot (take picture) settings.  Here is the result that worked for me:</p>
<script src="http://gist.github.com/292276.js"></script>
<p>As the script says, I now turn the camera on in record mode, disable the flash, and start the script.  After that, the camera will automatically take a photo whenever I plug in the USB to my computer.</p>
<p>More from this series:</p>
<ul>
<li>Part 1: Remote control camera with CHDK [YOU ARE HERE]</li>
<li><a href="/howto/makerbot-cam-2-wiring/">Part 2: Wiring it up!</a></li>
<li><a href="/howto/makerbot-cam-3-firmware/">Part 3: Updating the MakerBot Firmware</a></li>
<li><a href="/howto/makerbot-cam-4-repg/">Part 4: Updating ReplicatorG</a></li>
<li>Part 5: Printing with the Camera!</li>
</li>
<ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
