<?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; Blinky Lights</title>
	<atom:link href="http://www.doryexmachina.com/itpblog/category/asides/blinky-lights/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>New Socialbomb units!</title>
		<link>http://www.doryexmachina.com/itpblog/2008/03/11/new-socialbomb-units/</link>
		<comments>http://www.doryexmachina.com/itpblog/2008/03/11/new-socialbomb-units/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 01:32:32 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[ITP Projects]]></category>
		<category><![CDATA[etech]]></category>
		<category><![CDATA[evil]]></category>
		<category><![CDATA[ITP]]></category>
		<category><![CDATA[socialbomb]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2008/03/11/new-socialbomb-units/</guid>
		<description><![CDATA[So while I&#8217;ve bantered about the process of making the new SB 2.0 units and the things we&#8217;ve done with them, I haven&#8217;t given many nice images of them. So, let&#8217;s fix  that:

Yay pretty pictures!  The Documentation Station recently put up on the floor at ITP (a nice camera, a great lightbox, some [...]]]></description>
			<content:encoded><![CDATA[<p>So while I&#8217;ve bantered about the process of making the new SB 2.0 units and the things we&#8217;ve done with them, I haven&#8217;t given many nice images of them. So, let&#8217;s fix  that:</p>
<p><img src="http://farm3.static.flickr.com/2071/2327696276_d6b530a9a5.jpg?v=0" /></p>
<p>Yay pretty pictures!  The Documentation Station recently put up on the floor at ITP (a nice camera, a great lightbox, some spare lights and a nice backdrop) make for fast and easy documenting. While we&#8217;re on the subject, I don&#8217;t think I&#8217;ve ever posted anything animated about the SB&#8217;s, here&#8217;s a short video of them all blinking away:</p>
<p><code><br />
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.vimeo.com/moogaloop.swf?clip_id=757141&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color="><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=757141&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=" /></object><br /><a href="http://www.vimeo.com/757141/l:embed_757141">Socialbomb units in action</a> from <a href="http://www.vimeo.com/user324332/l:embed_757141">Mike Dory</a> on <a href="http://vimeo.com/l:embed_757141">Vimeo</a>.</code></p>
<p>When we programmed the new Socialbomb units, we designed them to talk to each other and share their scores. What we didn&#8217;t realize is that they&#8217;d all sync up their transmissions. The result looks extreeeeemly creepy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2008/03/11/new-socialbomb-units/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>Blip Festival</title>
		<link>http://www.doryexmachina.com/itpblog/2006/12/07/blip-festival/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/12/07/blip-festival/#comments</comments>
		<pubDate>Thu, 07 Dec 2006 21:03:17 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[Music and Tech]]></category>
		<category><![CDATA[Tech and Culture]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/12/07/blip-festival/</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; }


DSCN5598, by doryexmachina.
Dear blog, I&#8217;ve been rude and haven&#8217;t called.  I haven&#8217;t written.  I haven&#8217;t even stopped by to say hi on my way to the post office.  I&#8217;m sorry.  It&#8217;s [...]]]></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/314127308/"><img class="flickr-photo" src="http://static.flickr.com/122/314127308_8632da9e06.jpg" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/bentobox/314127308/">DSCN5598</a>, by <a href="http://www.flickr.com/people/bentobox/">doryexmachina</a>.</span></div>
<p class="flickr-yourcomment">Dear blog, I&#8217;ve been rude and haven&#8217;t called.  I haven&#8217;t written.  I haven&#8217;t even stopped by to say hi on my way to the post office.  I&#8217;m sorry.  It&#8217;s not you, it&#8217;s me.</p>
<p>I have to note quickly that due to finals, I&#8217;ve completely lost touch with all time and reality, so please forgive this half-assed entry, but I went to BLIP! last weekend to see Tristan Perich&#8217;s show (and musically fall in love with Bubblyfish and her DS-powered goodness).  I shall write more about this, but never before have Nintendo machines sounded so cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/12/07/blip-festival/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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>The tree evolves&#8230;</title>
		<link>http://www.doryexmachina.com/itpblog/2006/11/27/the-tree-evolves/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/11/27/the-tree-evolves/#comments</comments>
		<pubDate>Mon, 27 Nov 2006 07:05:52 +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/11/27/the-tree-evolves/</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; }


So i finally un-screwed my code and got the tri-color LED talking to Processing, which is right now telling it to change color every so often.  This is very good.  Right now it&#8217;s [...]]]></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/306897031/"><img class="flickr-photo" src="http://static.flickr.com/109/306897031_64630b10d8.jpg" /></a></div>
<p class="flickr-yourcomment">So i finally un-screwed my code and got the tri-color LED talking to Processing, which is right now telling it to change color every so often.  This is very good.  Right now it&#8217;s just pretty, the next step is bring the weather parser back and have it send color changes, but that&#8217;s nearly done as well.  And then, the actual tree&#8230;</p>
<p>But seen above is the shot of that one tri-color shining through the fiberoptic strands I might use.  Or ones like these, anyway &#8212; these particular ones were broken off the end of a crappy pen from Staples.  Yay for gaudy office supplies!</p>
<p>Movie of the LED on its own here: [ <a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/miniblinkyprocessing.mov">clicky</a> ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/11/27/the-tree-evolves/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/miniblinkyprocessing.mov" length="93742" type="video/quicktime" />
		</item>
		<item>
		<title>pComp Final &#8211; starting the tree</title>
		<link>http://www.doryexmachina.com/itpblog/2006/11/17/75/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/11/17/75/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 04:20:25 +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/11/17/75/</guid>
		<description><![CDATA[Okay, so my to-do list for pComp doesn&#8217;t look too horrible right now:

I&#8217;ve started to get this tree thing off the ground, first with a sketch:

Which is based largely on these two tree ideas:
[gem tree] and [wire bonsai]
Well, it looks pretty in code anyway.


This was the orignial idea:

And the tree&#8217;s code is a-comin&#8217; along.  [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so my to-do list for pComp doesn&#8217;t look too horrible right now:<br />
<img width="284" height="335" src="http://static.flickr.com/104/299197917_81ad994090.jpg?v=0" /></p>
<p>I&#8217;ve started to get this tree thing off the ground, first with a sketch:</p>
<p><a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/treesketch.jpg" rel="lightbox"><img src="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/treesketch.jpg" /></a></p>
<p>Which is based largely on these two tree ideas:</p>
<p>[<a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/tigereyetree.jpg">gem tree</a>] and [<a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/wiretree.jpg">wire bonsai</a>]</p>
<p>Well, it looks pretty in code anyway.<br />
<a href="http://www.flickr.com/photos/bentobox/299184872/"><img src="http://static.flickr.com/103/299184872_a1c681a5af.jpg?v=0" /></a></p>
<p><span id="more-75"></span></p>
<p>This was the orignial idea:</p>
<p><a href="http://flickr.com/photos/bentobox/299261918/"><img width="224" height="298" src="http://static.flickr.com/113/299261918_d99dad6378.jpg?v=0" /></a></p>
<p>And the tree&#8217;s code is a-comin&#8217; along.  This is the Arduino code for my (admittedly randomly picked) colors:</p>
<blockquote><p>int ledPin = 11; // LED connected to digital pin 13<br />
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 = 10;    // PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 10<br />
int ledB = 11;    // PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 11</p>
<p>void setup()<br />
{<br />
pinMode(ledPin, OUTPUT); // sets the digital pin as output<br />
Serial.begin(9600);<br />
}</p>
<p>void loop(){<br />
val = Serial.read();</p>
<p>if (val == &#8216;A&#8217;) {<br />
analogWrite(ledR, (255));    // PWM the LED with the pot value<br />
analogWrite(ledG, (100));    // PWM the LED with the pot value<br />
analogWrite(ledB, (100));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;B&#8217;) {<br />
analogWrite(ledR, (55));    // PWM the LED with the pot value<br />
analogWrite(ledG, (255));    // PWM the LED with the pot value<br />
analogWrite(ledB, (255));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;C&#8217;) {<br />
analogWrite(ledR, (100));    // PWM the LED with the pot value<br />
analogWrite(ledG, (255));    // PWM the LED with the pot value<br />
analogWrite(ledB, (155));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;D&#8217;) {<br />
analogWrite(ledR, (100));    // PWM the LED with the pot value<br />
analogWrite(ledG, (150));    // PWM the LED with the pot value<br />
analogWrite(ledB, (100));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;E&#8217;) {<br />
analogWrite(ledR, (55));    // PWM the LED with the pot value<br />
analogWrite(ledG, (250));    // PWM the LED with the pot value<br />
analogWrite(ledB, (100));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;E&#8217;) {<br />
analogWrite(ledR, (55));    // PWM the LED with the pot value<br />
analogWrite(ledG, (97));    // PWM the LED with the pot value<br />
analogWrite(ledB, (255));    // PWM the LED with the pot value<br />
}</p>
<p>if (val == &#8216;a&#8217;) {</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 />
}</p></blockquote>
<p>This much is good&#8230;</p>
<p>[<a href="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/DSCN4855.MOV">movie!</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/11/17/75/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.doryexmachina.com/itpblog/classwork/fall06/pcomp/final/DSCN4855.MOV" length="5821730" type="video/quicktime" />
		</item>
		<item>
		<title>Miniminiblinkyblinky!</title>
		<link>http://www.doryexmachina.com/itpblog/2006/11/11/miniminiblinkyblinky/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/11/11/miniminiblinkyblinky/#comments</comments>
		<pubDate>Sat, 11 Nov 2006 18:10:23 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[pComp]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/11/11/miniminiblinkyblinky/</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; }

She works!  My lil&#8217; mini withstood its first (and second) test of blinky lighting, thanks to the diagram Arduino.cc put up and Jane Oh&#8217;s neato how-to.
Top-down view (notes on Flickr page):

It&#8217;s pretty much the [...]]]></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/294595413/"><img class="flickr-photo" src="http://static.flickr.com/111/294595413_27f8ed6123.jpg" /></a><span class="flickr-caption" />She works!  My lil&#8217; mini withstood its first (and second) test of blinky lighting, thanks to the <a href="http://www.arduino.cc/en/Main/ArduinoBoardMini">diagram</a> Arduino.cc put up and J<a href="http://janeoh.wordpress.com/2006/11/09/mini-arduino/">ane Oh&#8217;s neato how-to</a>.</div>
<p class="flickr-yourcomment">Top-down view (notes on Flickr page):</p>
<p class="flickr-yourcomment"><a href="http://www.flickr.com/photos/bentobox/294593999/in/set-72157594370586462/"><img src="http://static.flickr.com/116/294593999_6f6810daee.jpg?v=0" /></a></p>
<p class="flickr-yourcomment">It&#8217;s pretty much the exact same as Jane&#8217;s setup, but yellow is RX, blue is TX, the upper red and black are power and ground for the arduino, the bottom black and red are power to the board.  The other red wire to the chip (and black on the board) are the reset switch.  I forgot to switch ports (and switch to 168) initially, but after that, worked like a charm!</p>
<p class="flickr-yourcomment">And MINI!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/11/11/miniminiblinkyblinky/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to talk about a show&#8230;</title>
		<link>http://www.doryexmachina.com/itpblog/2006/10/22/want-to-talk-about-a-show/</link>
		<comments>http://www.doryexmachina.com/itpblog/2006/10/22/want-to-talk-about-a-show/#comments</comments>
		<pubDate>Sun, 22 Oct 2006 21:35:20 +0000</pubDate>
		<dc:creator>mike.</dc:creator>
				<category><![CDATA[Blinky Lights]]></category>
		<category><![CDATA[Music and Tech]]></category>

		<guid isPermaLink="false">http://www.doryexmachina.com/itpblog/2006/10/26/want-to-talk-about-a-show/</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; }


scissor sisters, by nicole s.
Saw SS on Saturday at Hammerstein with Nicole and Adam &#8212; crowd sucked, but show kicked ass.  The new songs translated really nicely to the stage (though apparently they don&#8217;t [...]]]></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/nicoles/277921637/"><img class="flickr-photo" src="http://static.flickr.com/82/277921637_94c9e99fb3.jpg" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/nicoles/277921637/">scissor sisters</a>, by <a href="http://www.flickr.com/people/nicoles/">nicole s</a>.</span></div>
<p class="flickr-yourcomment">Saw SS on Saturday at Hammerstein with Nicole and Adam &#8212; crowd sucked, but show kicked ass.  The new songs translated really nicely to the stage (though apparently they don&#8217;t play &#8220;Ooh&#8221; live, damnit!).</p>
<p>And they had a curtain up in the back made entirely of blinky LED&#8217;s!  Adam and I were enthralled for a good 10 minutes by that alone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doryexmachina.com/itpblog/2006/10/22/want-to-talk-about-a-show/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
