<?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>Mike D. @ ITP &#187; Fall2006</title>
	<atom:link href="http://www.doryexmachina.com/itpblog/category/itp-classwork/fall2006/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doryexmachina.com/itpblog</link>
	<description>A tale of romance between a boy and his LED's</description>
	<lastBuildDate>Fri, 11 Sep 2009 03:44:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Exploding cup of lentils</title>
		<link>http://www.doryexmachina.com/itpblog/2007/01/27/exploding-cup-of-lentils/</link>
		<comments>http://www.doryexmachina.com/itpblog/2007/01/27/exploding-cup-of-lentils/#comments</comments>
		<pubDate>Sat, 27 Jan 2007 19:11:39 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Net Objects]]></category>
		<category><![CDATA[pComp]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2007/01/23/exploding-cup-of-lentils/</guid>
		<description><![CDATA[Okay, actually, it didn&#8217;t quite work out like that at all, but here is the almost-a-week-overdue story of how I was tasked to make an improv project for my Networked Objects class (which involved monkeys, pudding, lentils, cups, etc), how it all kinda worked, and then how it all mostly sucked in the end.
I started [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, actually, it didn&#8217;t quite work out like that at all, but here is the almost-a-week-overdue story of how I was tasked to make an improv project for my Networked Objects class (which involved monkeys, pudding, lentils, cups, etc), how it all kinda worked, and then how it all mostly sucked in the end.</p>
<p>I started out with a simple concept: we were tasked to make a project in one week that had to interact with the user.  It had to use one or more from a list of verbs (including blowing, tapping, pushing, etc), a list of random objects (the aforementioned monkeys, pudding, lentils, cups, and playground balls), and must produce a reaction (including sound, light, movement, etc).</p>
<p>I started out with a computer fan, a big cup (stolen from my kitchen), a bag of lentils (thank you Adam Simon!) and a piezo attached to my arduino.  However, after a few hours of playing around with various setups (and hot glue, foamcore, and a few other helping items), it became clear that it just wasn&#8217;t going to work out, and thus the concept was abandoned.</p>
<p><a href="http://www.flickr.com/photos/bentobox/370139916/in/set-72157594501400034/"><img src="http://farm1.static.flickr.com/133/370139916_88194f2904.jpg?v=0" /></a></p>
<p>So, since I fortunately have a huge freaking pile of white LED&#8217;s from last semester, I wired up three of them, and plugged them through a cup from the water station.  The original plan had been to wire fiberoptics through the bottom, however they were being cantankerous and at this point time was of the essence.  Once they were set, I stuck a piezo to the edge of the cup, and hooked it all up to an arduino mini.  The plan was that if you flicked the cup, the lights would blink.</p>
<p><a href="http://www.flickr.com/photos/bentobox/370139214/in/set-72157594501400034/"><img src="http://farm1.static.flickr.com/145/370139214_fe339cfb23.jpg?v=0" /></a></p>
<p>What I ended up with was this:  a cup of lentils with lights&#8230; except the lights went off constantly.  Somewhere on the trip back from Jersey City (or perhaps just due to the insanity that is the ITP floor), the piezo just stopped behaving properly, and when it was time to present, my &#8220;interactive&#8221; concept wasn&#8217;t interactive at all &#8212; it didn&#8217;t require user input for anything.</p>
<p>So, in short, it didn&#8217;t quite work out as planned, but the original concept, I still think, would have been great.  I&#8217;ll be honest, I hope I get an excuse to build that again later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2007/01/27/exploding-cup-of-lentils/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That&#8217;s it, show&#8217;s over&#8230;</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/21/thats-it-shows-over/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/21/thats-it-shows-over/#comments</comments>
		<pubDate>Thu, 21 Dec 2006 18:26:13 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Fall2006]]></category>
		<category><![CDATA[ITP Show]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/21/thats-it-shows-over/</guid>
		<description><![CDATA[ .flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; } 
 	
fallshow06, by doryexmachina.
&#160;
]]></description>
			<content:encoded><![CDATA[<style type="text/css"> .flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; } </style>
<p class="flickr-frame"> 	<a href="http://www.flickr.com/photos/bentobox/329285693/" title="photo sharing"><img src="http://farm1.static.flickr.com/124/329285693_3441fdb9a4.jpg" class="flickr-photo" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/329285693/">fallshow06</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></p>
<p class="flickr-yourcomment">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/21/thats-it-shows-over/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ICM Final &#8211; Drawing music is dun.</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/14/icm-final-drawing-music-is-dun/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/14/icm-final-drawing-music-is-dun/#comments</comments>
		<pubDate>Thu, 14 Dec 2006 17:17:00 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[ICM]]></category>
		<category><![CDATA[ITP Projects]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/14/icm-final-drawing-music-is-dun/</guid>
		<description><![CDATA[







]]></description>
			<content:encoded><![CDATA[<p><a href="http://static.flickr.com/136/320125939_47c904756d_b.jpg" rel="lightbox"><img src="http://static.flickr.com/136/320125939_47c904756d.jpg?v=0" /></a></p>
<p><span id="more-95"></span></p>
<p><a href="http://static.flickr.com/123/320125910_abbeaef656.jpg" rel="lightbox"><img src="http://static.flickr.com/123/320125910_abbeaef656.jpg?v=0" /></a></p>
<p><a href="http://static.flickr.com/127/320125926_0b2ed69636.jpg" rel="lightbox"><img src="http://static.flickr.com/127/320125926_0b2ed69636.jpg?v=0" /></a></p>
<p><a href="http://static.flickr.com/133/320125989_edb982b526.jpg" rel="lightbox"><img src="http://static.flickr.com/133/320125989_edb982b526.jpg?v=0" /></a></p>
<p><a href="http://static.flickr.com/134/321483838_93ab057c28.jpg" rel="lightbox"><img src="http://static.flickr.com/134/321483838_93ab057c28.jpg?v=0" /></a></p>
<p><a href="http://static.flickr.com/123/321483742_e9f2b659a5.jpg" rel="lightbox"><img src="http://static.flickr.com/123/321483742_e9f2b659a5.jpg?v=0" /></a></p>
<p><a href="http://static.flickr.com/129/321483770_1593b59ad0.jpg" rel="lightbox"><img src="http://static.flickr.com/129/321483770_1593b59ad0.jpg?v=0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/14/icm-final-drawing-music-is-dun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing, I hate you</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/12/processing-i-hate-you/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/12/processing-i-hate-you/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 05:47:57 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[ICM]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/12/processing-i-hate-you/</guid>
		<description><![CDATA[
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }


Picture 45, by doryexmachina.
Seriously.  ICM is proving to be at least 5x as complicated/annoying as previous planned.  I&#8217;m working with Lesley (and, unofficially, Tom) to try to get Processing to &#8220;play&#8221; written lines, [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }
</style>
<div class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/bentobox/320125910/"><img class="flickr-photo" src="http://static.flickr.com/123/320125910_abbeaef656.jpg" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/320125910/">Picture 45</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></div>
<p class="flickr-yourcomment">Seriously.  ICM is proving to be at least 5x as complicated/annoying as previous planned.  I&#8217;m working with Lesley (and, unofficially, Tom) to try to get Processing to &#8220;play&#8221; written lines, and in this case we&#8217;re using video tracking (reduced to just its edges) and trying to have processing read that, output midi, and have that midi played by Absynth.  That much works.  But in terms of making it even remotely controllable or useful&#8230;</p>
<p>Arg.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/12/processing-i-hate-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to ITP during finals</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/11/welcome-to-itp-during-finals/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/11/welcome-to-itp-during-finals/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 03:03:18 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Fall2006]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/11/welcome-to-itp-during-finals/</guid>
		<description><![CDATA[ .flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; } 
 	
DSCN5978, by doryexmachina.
 	Tom&#8217;s desktop.  It says it all.
]]></description>
			<content:encoded><![CDATA[<style type="text/css"> .flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; } </style>
<p class="flickr-frame"> 	<a href="http://www.flickr.com/photos/bentobox/320117909/" title="photo sharing"><img src="http://static.flickr.com/134/320117909_66af8c3a56.jpg" class="flickr-photo" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/320117909/">DSCN5978</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></p>
<p class="flickr-yourcomment"> 	Tom&#8217;s desktop.  It says it all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/11/welcome-to-itp-during-finals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArborOptics &#8211; a recap</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/11/arboroptics-a-recap/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/11/arboroptics-a-recap/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 06:45:37 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[ITP Projects]]></category>
		<category><![CDATA[pComp]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/11/arboroptics-a-recap/</guid>
		<description><![CDATA[
Having spent the entire second half of the semester focused on one single project for Physical Computing, it&#8217;s very difficult to take a few steps back and try to recap the entire experience.  However, as that&#8217;s pretty much the whole point of presenting to an audience, let&#8217;s give this a try, shall we?
[more after [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/bentobox/318120480/in/set-72157594412802428/"><img src="http://static.flickr.com/138/318120480_2184062da1.jpg?v=0" /></a></p>
<p>Having spent the entire second half of the semester focused on one single project for Physical Computing, it&#8217;s very difficult to take a few steps back and try to recap the entire experience.  However, as that&#8217;s pretty much the whole point of presenting to an audience, let&#8217;s give this a try, shall we?</p>
<p>[more after the jump]</p>
<p><span id="more-88"></span></p>
<p>I started this with a very simple idea &#8212; I wanted to bring a piece of the outdoors to the indoor space.  The room in my apartment with all my pcomp and studio gear has no windows, and if one were to spend more than about 20 minutes in that space (or any room with no windows), a sense of detachment and general malaise seems to set in.  In my case, what I missed most, even more than the general &#8220;gee, what&#8217;s going on out there&#8221; feeling, was not seeing trees.  I grew up surrounded by big, old, dense forests, and to constantly be in an area with very few trees is really off-putting for me.</p>
<p>So, after a bit of thought, the best direction for this outdoor ->> indoor transfer seemed to be making a tree of my own, and that this tree could convey the changes in the outdoor world primarily by calming colors.  I wanted this whole project to stay very simple and calming in appearance &#8212; this should be as simple and beautiful as a tree itself.<br />
The process was not so beautiful, but was absolutely way more fun than expected (and I expected it&#8217;d be fun!).  I worked by myself on this project, primarily because I really wanted an excuse to REALLY learn the code and the process start to finish, and I really feel I did accomplish that &#8212; there are things I understand now about Arduino and pComp in general that I wouldn&#8217;t have ever dreamed earlier this semester.</p>
<p>I started by writing a very simple program to PWM a tri-color LED, changing each pin&#8217;s color individually, allowing me to access nearly every color of the rainbow.  After that was up and running, I started to think of ways to control that color based on the weather.  What I ended up doing was using Processing to parse Yahoo&#8217;s XML weather feed (thanks to the wonderful simpleML library from Daniel Shiffman), and having Processing send single-letter values to Arduino based on the temperature value it picked up.  In the end, I went with a new letter for every five degrees Fahrenheit, but I tried 10 and 20 first.  Turns out that 20-degree shifts don&#8217;t happen all that often, and hence, it was kinda boring to watch.</p>
<p>The next step was to add a structure.  I&#8217;d initially thought of making a wire structure and running fiberoptic cables through it, but I ended up just ripping the end off a crappy pen from Staples (which had a bunch of several-inch-long fiberoptic strands), and plugging the LED in right below them.  I wrapped plain ol&#8217; copper wire around the bottom to give the appearance of a trunk, and split off groups of 10 strands or so (also wrapped in said copper wire) to make branches.  I wrapped the LED itself in a piece of plastic (cut off a piece of standard packaging from a mouse I&#8217;d bought) and hotglued that to the base of the tree, and then put all that top of a piece of foamcore with a hole in the middle.  Better picture of that whole assembly below:</p>
<p><a href="http://flickr.com/photos/bentobox/310799250/in/set-72157594399862492/"><img src="http://static.flickr.com/112/310799250_a6f6b372ac.jpg?v=0" /></a></p>
<p>This is what the guts looked like before they were completed and stashed in the base:</p>
<p><a href="http://flickr.com/photos/bentobox/318111013/in/set-72157594412802428/"><img src="http://static.flickr.com/136/318111013_aff52214a1.jpg?v=0" /></a></p>
<p>When I first started showing the tree off, I was really pleased to see that people really seemed to like the design and concept (though some didn&#8217;t see why it had to be a tree).  More than anything, people really seemed to be happy with the color and styling, which was the whole point &#8212; to be calmed by an ambient display.  The weather function ended up as kinda secondary, but it still seemed to be doing what I&#8217;d set out to do.  However, the second thing everybody seemed to do (after asking what the hell it was) was to try to touch the tree.  At this point, nothing happened when people touched it (or, honestly, in any way having to do with local input).  So, I added in a snippet of code for the Arduino that made it pulse other colors quickly (at varying speeds for the red, green and blue so as to have a whole bunch of random colors) and wired in a rolling rocker switch (which, in a super-hacky way, was triggered when the wires were pushed down hard enough).<br />
After all that, I wired up a perfboard and attached (via headers) the tri-color LED, Arduino Mini (chosen originally for its neato-tiny size, but eventually necessary because my code was 14k and the minis can take 16k, whereas the full-size Arduinos can only do 8k), USB connector, and eventually a switch (to make the tree temporarily go spastic).</p>
<p><a href="http://flickr.com/photos/bentobox/318115990/in/set-72157594412802428/"><img src="http://static.flickr.com/95/318115990_dfab53e48a.jpg?v=0" /></a></p>
<p>So, in short, it was successful.  It actually WORKED when I was presenting it (a lesson learned from my up-in-flames midterm project), it seemed to go over well with people, and it gave me an excuse to <em>really</em> learn the ins and outs of coding and physical computing.  I&#8217;m pretty happy with it, and despite some things left undone (xBee integration/wireless usage, additional environmental inputs, a lil&#8217; cocktail umbrella that opens or closes depending on rain percentages), it was a pretty successful experience.</p>
<p>The code, for anyone curious, is below for both the Arduino and Processing sides:</p>
<p>//=========================</p>
<p>Arduino code:</p>
<blockquote><p>//PWM&#8217;ing a tri-color LED that pulses in color according to the weather<br />
//DxM, ITP Fall 2006</p>
<p>int val = 0;<br />
int ledR = 9;    // PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 9<br />
int ledG = 11;    // PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 11<br />
int ledB = 10;    // PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 10<br />
int b = 50;<br />
int c = 0;<br />
int potPin = 2;    // Analog input pin that the potentiometer is attached to<br />
int p = 0;   // value read from the pot<br />
int d = 0; //dimmer value<br />
int bdir = 1;<br />
int testPin = 13;<br />
int counter = 0;<br />
int switchPin = 7;<br />
int switchState = 0;</p>
<p>void setup()<br />
{<br />
Serial.begin(9600);</p>
<p>pinMode(switchPin, INPUT);       // set the switch pin to be an input</p>
<p>//display test//<br />
digitalWrite(testPin, HIGH);<br />
delay(100);<br />
digitalWrite(testPin, LOW);<br />
delay(100);<br />
digitalWrite(testPin, HIGH);<br />
delay(100);<br />
digitalWrite(testPin, LOW);<br />
delay(100);<br />
digitalWrite(testPin, HIGH);<br />
delay(100);<br />
digitalWrite(testPin, LOW);<br />
delay(100);<br />
}</p>
<p>void loop(){<br />
// read the switch input:<br />
switchState = digitalRead(switchPin);</p>
<p>if (switchState == 1) {<br />
// if the switch is closed:</p>
<p>analogWrite(ledR, (.816 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.757 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.954 * b));    // PWM the LED with the pot value</p>
<p>if ((b <= 49)){ //&#038;&#038; (b < 10)){<br />
//  Serial.println("going up!");<br />
bdir = -bdir;<br />
}</p>
<p>if (b >= 1000){<br />
//  Serial.println(&#8221;going down!&#8221;);<br />
bdir = -bdir;<br />
}<br />
b =  (b + ((bdir) *2));<br />
p = analogRead(potPin); // read the pot value<br />
delay(5);<br />
d = p/10;<br />
}</p>
<p>else{<br />
val = Serial.read();</p>
<p>if (val == &#8216;a&#8217;) { //off</p>
<p>digitalWrite(ledR, LOW); // sets the LED off<br />
digitalWrite(ledG, LOW); // sets the LED off<br />
digitalWrite(ledB, LOW); // sets the LED off<br />
}<br />
if (val == &#8216;A&#8217;) { // ends with 0<br />
analogWrite(ledR, (.215 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value</p>
<p>}</p>
<p>if (val == &#8216;B&#8217;) { // ends with 5<br />
analogWrite(ledR, (.55 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.225 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;C&#8217;) { // ends with 10<br />
analogWrite(ledR, (.100 * b ));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.155 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;D&#8217;) { // ends with 15<br />
analogWrite(ledR, (.100 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.150 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.100 *b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;E&#8217;) { // ends with 20<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.250 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.100 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;F&#8217;) { // ends with 25<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.057 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;G&#8217;) { // ends with 30<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.097 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;H&#8217;) { // ends with 35<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.154 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;I&#8217;) { // ends with 40<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.139 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;J&#8217;) { // ends with 45<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;K&#8217;) { // ends with 50<br />
analogWrite(ledR, (.025 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.125 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;L&#8217;) { // ends with 55<br />
analogWrite(ledR, (.025 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.247 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;M&#8217;) { // ends with 60<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.093 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;N&#8217;) { // ends with 65<br />
analogWrite(ledR, (.025 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.101 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;O&#8217;) { // ends with 70<br />
analogWrite(ledR, (.055 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.075 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;P&#8217;) { // ends with 75<br />
analogWrite(ledR, (.087 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.025 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;Q&#8217;) { // ends with 80<br />
analogWrite(ledR, (.155 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.027 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;R&#8217;) { // ends with 85<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.020 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;S&#8217;) { // ends with 90<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.171 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.025 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;T&#8217;) { // ends with 95<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.139 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.025 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;U&#8217;) { // ends with 100<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.101 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.025 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;V&#8217;) { // ends with 105<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.025 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.025 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;W&#8217;) { // TEST RED<br />
analogWrite(ledR, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.000 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.000 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;X&#8217;) { // TEST GREEN<br />
analogWrite(ledR, (.000 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.255 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.000 * b));    // PWM the LED with the pot value<br />
}<br />
if (val == &#8216;Y&#8217;) { // TEST BLUE<br />
analogWrite(ledR, (.000 * b));    // PWM the LED with the pot value<br />
analogWrite(ledG, (.000 * b));    // PWM the LED with the pot value<br />
analogWrite(ledB, (.255 * b));    // PWM the LED with the pot value<br />
}</p>
<p>if ((b <= 49)){<br />
//  Serial.println("going up!");<br />
bdir = -bdir;<br />
}</p>
<p>if (b >= 1000){<br />
//  Serial.println(&#8221;going down!&#8221;);<br />
bdir = -bdir;<br />
}<br />
b =  (b + ((bdir) *2));</p>
<p>//    p = analogRead(potPin); // read the pot value<br />
//  analogWrite(led, potValue/4);  // PWM the LED with the pot value (divided by 4 to fit in a byte)<br />
//  Serial.println(p);      // print the pot value back to the debugger pane<br />
//   delay(100);<br />
//  Serial.println(p &#8211; 600);<br />
delay(5);<br />
// Serial.println(bdir);<br />
c = b * 10;<br />
//  Serial.println(c);<br />
d = p/10;<br />
}<br />
}</p></blockquote>
<p>Processing code:</p>
<blockquote><p>// PWM&#8217;ing a tri-color LED based on weather temperatures</p>
<p>import processing.serial.*;</p>
<p>String weather = &#8220;&#8221;;<br />
String[] zips = {<br />
&#8220;10003&#8243;,&#8221;21209&#8243;,&#8221;90210&#8243;};</p>
<p>int temp;<br />
int counter = 0;</p>
<p>// The serial port:<br />
Serial myPort;</p>
<p>void setup(){<br />
getWeather(zips[counter]);<br />
// List all the available serial ports:<br />
println(Serial.list());</p>
<p>// Open whatever port is the one you’re using.<br />
myPort = new Serial(this, Serial.list()[0], 9600);</p>
<p>println(temp);<br />
println(zips);<br />
println(weather);<br />
}</p>
<p>void draw(){</p>
<p>if (temp >= -40 &#038;&#038; temp <=0){<br />
myPort.write('A');<br />
println("ass-cold!");<br />
}<br />
if (temp >= 0 &#038;&#038; temp <=5){<br />
myPort.write('B');<br />
}<br />
if (temp >= 5 &#038;&#038; temp <=10){<br />
myPort.write('C');<br />
}<br />
if (temp >= 10 &#038;&#038; temp <=15){<br />
myPort.write('D');<br />
}<br />
if (temp >= 115 &#038;&#038; temp <=20){<br />
myPort.write('E');<br />
}<br />
if (temp >= 20 &#038;&#038; temp <=25){<br />
myPort.write('F');<br />
}<br />
if (temp >= 25 &#038;&#038; temp <=30){<br />
myPort.write('G');<br />
}<br />
if (temp >= 30 &#038;&#038; temp <=35){<br />
myPort.write('H');<br />
}<br />
if (temp >= 35 &#038;&#038; temp <=40){<br />
myPort.write('I');<br />
}<br />
if (temp >= 40 &#038;&#038; temp <=45){<br />
myPort.write('J');<br />
}<br />
if (temp >= 45 &#038;&#038; temp <=50){<br />
myPort.write('K');<br />
}<br />
if (temp >= 50 &#038;&#038; temp <=55){<br />
myPort.write('L');<br />
}<br />
if (temp >= 55 &#038;&#038; temp <=60){<br />
myPort.write('M');<br />
}<br />
if (temp >= 60 &#038;&#038; temp <=65){<br />
myPort.write('N');<br />
}<br />
if (temp >= 65 &#038;&#038; temp <=70){<br />
myPort.write('O');<br />
}<br />
if (temp >= 70 &#038;&#038; temp <=75){<br />
myPort.write('P');<br />
}<br />
if (temp >= 75 &#038;&#038; temp <=80){<br />
myPort.write('Q');<br />
}<br />
if (temp >= 80 &#038;&#038; temp <=85){<br />
myPort.write('R');<br />
}<br />
if (temp >= 85 &#038;&#038; temp <=90){<br />
myPort.write('S');<br />
}<br />
if (temp >= 90 &#038;&#038; temp <=95){<br />
myPort.write('T');<br />
}<br />
if (temp >= 95 &#038;&#038; temp <=100){<br />
myPort.write('U');<br />
}<br />
if (temp >= 100 &#038;&#038; temp <=105){<br />
myPort.write('V');<br />
}</p>
<p>//essplain it, yo.///////<br />
println(temp);<br />
println(weather);</p>
<p>}</p>
<p>void getWeather(String zip) {<br />
//Get all the HTML/XML source code into an array of strings (each line is one element in the array)<br />
String url = "http://itp.nyu.edu/icm/proxy/proxy.php?url=http://xml.weather.yahoo.com/forecastrss?p=" + zip;<br />
String[] lines = loadStrings(url);</p>
<p>String xml = join(lines, " "); // Get rid of the array and make it one very long String</p>
<p>// The manual way to concatenate<br />
// String xml = "";<br />
// for (int i = 0; i < lines.length; i++) {<br />
//   xml += lines[i];<br />
// }</p>
<p>// Searching for weather condition<br />
String lookfor = " String end = "\"";<br />
weather = giveMe(xml,lookfor,end);</p>
<p>// Searching for temperature<br />
lookfor = "temp=\"";<br />
temp = int(giveMe(xml,lookfor,end));</p>
<p>}</p>
<p>// A function that returns a substring between two substrings<br />
String giveMe(String s, String before, String after) {<br />
String found = "";<br />
int start = s.indexOf(before);  // Find the index of the beginning tag<br />
if (start == -1) return ""; // If we don't find anything, send back a blank String<br />
start += before.length(); // Move to the end of the beginning tag<br />
int end = s.indexOf(after,start); // Find the index of the end tag<br />
if (end == -1) return ""; // If we don't find the end tag, send back a blank String<br />
return s.substring(start,end); // Return the text in between<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/11/arboroptics-a-recap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun with iStopMotion</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/05/fun-with-istopmotion/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/05/fun-with-istopmotion/#comments</comments>
		<pubDate>Tue, 05 Dec 2006 22:32:43 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[CommLab]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/05/fun-with-istopmotion/</guid>
		<description><![CDATA[Okay, it&#8217;s official: I love stop motion.  Tom and I spent a day at my apartment shooting the great escape of the contents of Tom&#8217;s pocket, across a table, into sofas or out of the room.  We had a pretty good routine going, with Tom moving one set of stuff and me moving [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, it&#8217;s official: I love stop motion.  Tom and I spent a day at my apartment shooting the great escape of the contents of Tom&#8217;s pocket, across a table, into sofas or out of the room.  We had a pretty good routine going, with Tom moving one set of stuff and me moving a few other things and taking the shots.</p>
<p>For reasons unbeknownst to me, I can&#8217;t get the embedded movie to show as I&#8217;d wanted, so click here for the whole thing:</p>
<p>[<a href="http://doryexmachina.com/itpblog/classwork/fall06/commlab/FinalPenniesYay.mov">movie</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/05/fun-with-istopmotion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://doryexmachina.com/itpblog/classwork/fall06/commlab/FinalPenniesYay.mov" length="49525407" type="video/quicktime" />
<enclosure url="http://itp.configureduser.com/wp-content/uploads/2006/12/stopmotion.mov" length="2565145" type="video/quicktime" />
		</item>
		<item>
		<title>Perfy perfy</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/03/perfy-perfy/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/03/perfy-perfy/#comments</comments>
		<pubDate>Sun, 03 Dec 2006 07:34:20 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[ITP Projects]]></category>
		<category><![CDATA[pComp]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/03/perfy-perfy/</guid>
		<description><![CDATA[
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }


Perfy perfy, by doryexmachina.
Huzzah!  The Mini and the USB plug have been perfboard&#8217;d!!
]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }
</style>
<div class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/bentobox/312650358/"><img class="flickr-photo" src="http://static.flickr.com/114/312650358_d33a6e61d7.jpg" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/312650358/">Perfy perfy</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></div>
<p class="flickr-yourcomment">Huzzah!  The Mini and the USB plug have been perfboard&#8217;d!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/03/perfy-perfy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TREE!!!!!</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/01/tree/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/01/tree/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 04:05:06 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[ITP Projects]]></category>
		<category><![CDATA[pComp]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/01/tree/</guid>
		<description><![CDATA[
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }


DSCN5353, by doryexmachina.
More pictures here.
Movies of said tree:
]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }
</style>
<div class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/bentobox/310798930/"><img class="flickr-photo" src="http://static.flickr.com/109/310798930_5b111d9550.jpg" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/310798930/">DSCN5353</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></div>
<p class="flickr-yourcomment">More pictures <a href="http://flickr.com/photos/bentobox/sets/72157594399862492/">here</a>.</p>
<p class="flickr-yourcomment"><a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/tree">Movies of said tree</a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/01/tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CommLab &#8211; The Secret Life of Pennies</title>
		<link>http://www.doryexmachina.com/itpblog/2006/11/29/commlab-the-secret-life-of-pennies/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/11/29/commlab-the-secret-life-of-pennies/#comments</comments>
		<pubDate>Wed, 29 Nov 2006 16:50:55 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[CommLab]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/11/29/commlab-the-secret-life-of-pennies/</guid>
		<description><![CDATA[So, after a lovely long weekend and way too much food, here we are again &#8212; back to ITP, back to CommLab, and back to bad ideas for stories, put on storyboards, soon to be made into films.  Whee!
For this adventure, I&#8217;m working with Tom to use iStopMotion (because I really did have way too [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/bentobox/309498318/in/set-72157594397506397/"><img src="http://static.flickr.com/108/309498318_752955bd34.jpg?v=0" /></a>So, after a lovely long weekend and way too much food, here we are again &#8212; back to ITP, back to CommLab, and back to bad ideas for stories, put on storyboards, soon to be made into films.  Whee!</p>
<p>For this adventure, I&#8217;m working with Tom to use iStopMotion (because I really did have way too much fun the last time around with stop motion stuffs) to capture the secret life of pennies.  No, not like those commercials you see on tv for CoinStar.  I have no idea what you&#8217;re talking about.  Shut UP!  Actually, in all seriousness, not so much like that at all &#8212; this would really be animating a pile of pennies (joined by others as the short goes on) doing stunts, crawling down a table leg, and dispersing again.  The storyboarding here was done via camera, (A) because that&#8217;s how we&#8217;ll have to do the real version, and (B) because I can&#8217;t draw for garbage.</p>
<p>Should be fun to shoot&#8230;</p>
<p>For full storyboard set: [<a href="http://flickr.com/photos/bentobox/sets/72157594397506397/">clicky</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/11/29/commlab-the-secret-life-of-pennies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
