<?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>Pixel Punchout &#187; Physical Computing</title>
	<atom:link href="http://pixelpunchout.com/tag/physical-computing/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixelpunchout.com</link>
	<description>digital/social media, technology, internet phenomena, + design (ninjas)</description>
	<lastBuildDate>Tue, 07 Sep 2010 06:33:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Meet TweetChime</title>
		<link>http://pixelpunchout.com/2009/12/meet-tweetchime/</link>
		<comments>http://pixelpunchout.com/2009/12/meet-tweetchime/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 06:05:33 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[Intro to Computational Media]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[TweetChime]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=560</guid>
		<description><![CDATA[TweetChime Live Demo from cindy wong on Vimeo. Helping people overcome long distances, TweetChime is a melodic chime that communicates people&#8217;s sentiments and transmits them into melody. So, no matter where you are, you can let your loved ones know you&#8217;re thinking of them and they can hear your sentiment in real-time in sound. By [...]]]></description>
			<content:encoded><![CDATA[<p><object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=8017119&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=8017119&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/8017119">TweetChime Live Demo</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Helping people overcome long distances, <a href="http://itp.nyu.edu/~cw1028/pcomp/tweetchime.html" target="_blank">TweetChime</a> is a melodic chime that communicates people&#8217;s sentiments and transmits them into melody. So, no matter where you are, you can let your loved ones know you&#8217;re thinking of them and they can hear your sentiment in real-time in sound. By using Twitter, you can send your preferred sentiment, anytime and anywhere at your convenience.</p>
<p>In this case, in the video above, my brother, Pat has sent me this coded message: &#8220;<a onclick="pageTracker._trackPageview('/exit/to/tweetchime')" href="http://twitter.com/tweetchime" target="_blank"><strong>@tweetchime</strong></a> [dinnertime] awww yeah!&#8221; Why? Because he has an odd sense of humor  from living in Mobile, Al. which somehow is lost on me  in New York City. Ah, family.</p>
<h2>Who Could Use TweetChime?</h2>
<p>TweetChime is great for ambient contact technology. In other words, you can keep yourself open to others without them having to actively message you (through phone/IM/email). Vice versa, they can quickly tweet you and have the satisfaction of knowing that you will hear their tweet melody in real time on your side.  The TweetChime is unobtrusive and (if prototyped further) can blend into your household.</p>
<ul>
<li>Long distance friends/family</li>
<li>Parents who want to communicate with their kids (who can&#8217;t read time, distinguish technology)</li>
<li>Visually Impaired</li>
</ul>
<h2>Interact with TweetChime:</h2>
<p>Would you like to send a sentiment to me? Please tweet to <strong>@tweetchime</strong>, the TweetChime&#8217;s Twitter account.</p>
<p><strong>How to Send: </strong>TweetChime recognizes the coded message within the brackets [ ]. The TweetChime website will scan Twitter&#8217;s search results looking for messages aimed at @tweetchime.</p>
<p>I have programmed a reply that TweetChime can recognize from a Twitter message. Choose your choice below:</p>
<ul>
<li>@tweetchime [be happy]</li>
<li>@tweetchime [congratulations]</li>
<li>@tweetchime [missing you]</li>
<li>@tweetchime [holla]</li>
<li>@tweetchime [coming home]</li>
<li>@tweetchime [dinner time]</li>
</ul>
<p><em>ex: cwong08 says: &#8220;@tweetchime [dinner time] Mom is serving mashed potatoes and turkey! Mmmm!</em></p>
<p><strong>Where Does My Tweet Go?</strong><a href="http://itp.nyu.edu/~cw1028/pcomp/tweetchime_beta.html" target="_blank"></a></p>
<p><a href="http://itp.nyu.edu/~cw1028/pcomp/tweetchime_beta.html" target="_blank">TweetChime</a> will be searching for all mentions of itself (@tweetchime) through Twitter&#8217;s public search time line. When it finds the coded tweet (1 of the 6 above), it&#8217;ll understand it and output into a short melody that the TweetChime owner will understand.</p>
<p><strong>See It In Action</strong></p>
<h2><span id="more-560"></span></h2>
<h2><strong>Software Setup:</strong></h2>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/picture-1.png"></a><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/screengrab_tweetchimewebsite.png" title="screengrab_tweetchimewebsite" rel="lightbox[560]"><img class="alignnone size-full wp-image-592" title="screengrab_tweetchimewebsite" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/screengrab_tweetchimewebsite.png" alt="screengrab_tweetchimewebsite" width="500" height="392" /></a></p>
<p><em>TweetChime &#8211; home page for the TweetChime machine</em></p>
<p>So, what&#8217;s running the online component of TweetChime? TweetChime involves 2 websites: TweetChime, the <a href="http://itp.nyu.edu/~cw1028/pcomp/tweetchime.html" target="_blank">html site </a>and a <a href="http://itp.nyu.edu/~cw1028/pcomp/tweetchime_rss.php" target="_blank">php site</a>. The recipient of all these TweetChime melodies has the TweetChime website open in their web browser. The TweetChime website is constantly communicating to its PHP site (via AJAX) which is  checking a RSS feed of Twitter&#8217;s search results for mentions of @tweetchime [coded message here]. The ones that are properly formatted get grabbed to TweetChime&#8217;s html website. That website has Javascript coding which allows serial communication between the PC and the Arduino. The website passes the encoded values (for example, [be happy] = byte value 65)  within the Twitter messages to the Arduino which can understand them and output the commands associated with each coded byte value. The beauty is that TweetChime will only play fresh tweets so that folks will always know that the tweet melody heard is something that was sent by someone in real time.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/picture-31.png"></a><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/phpcode.jpg" title="phpcode" rel="lightbox[560]"><img class="alignnone size-large wp-image-593" title="phpcode" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/phpcode-1024x575.jpg" alt="phpcode" width="500" height="284" /></a></p>
<p><em>PHP site that is parsing the tweets that people are sending to @tweetchime</em></p>
<p><em><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/serialcommunication_javascript.gif" title="serialcommunication_javascript" rel="lightbox[560]"><img class="alignnone size-large wp-image-594" title="serialcommunication_javascript" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/serialcommunication_javascript-1024x421.gif" alt="serialcommunication_javascript" width="500" height="205" /></a></em></p>
<p><em>Javascript receives the parsed tweets and transmits to Arduino to output to TweetChime</em></p>
<ul>
<li><strong>Update: </strong>Managed to parse Twitter RSS data to now include the current Twitter sender, Twitter sender&#8217;s icon<em><br />
</em></li>
</ul>
<h2>Physical Setup</h2>
<p>Ingredients: 5 Servo Motors, 1 Arduino, 1 BreadBoard, 22-gauge wires, 5 large metal wind chimes, 5 tiny metal chime pipes (to act as knockers), plywood, DC jack, 12V DC adapter, voltage regulator, heat shield (to protect the voltage regulator from overheating)</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/sany0006.jpg" title="TweetChime Machine Setup" rel="lightbox[560]"><img class="alignnone size-large wp-image-564" title="TweetChime Machine Setup" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/sany0006-1024x775.jpg" alt="TweetChime Machine Setup" width="500" height="375" /></a></p>
<p>Servo Motors are mounted to a back board. Attached to each servo motor is a smaller wind chime pipe that acts as a knocker to produce a clear ring against the hanging wind chime tube pipe.<em> </em>The Arduino and breadboard are mounted behind the back board.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/backoftweetchime.jpg" title="backoftweetchime" rel="lightbox[560]"><img class="alignnone size-full wp-image-565" title="backoftweetchime" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/backoftweetchime.jpg" alt="backoftweetchime" width="500" height="400" /></a></p>
<p><strong>Arduino Coding:</strong><br />
Did you know that the servo library can now handle multiple servos without it overloading the timing involved in it? I originally wrote my Arduino code to include delays with the Servo Library and for whatever reason, when I added my 4th servo motor, it got jittery, ran abruptly and sometimes went on randomly. It may or may not have been a power issue involving a misplaced wire. However, after talking to my professor Tom Igoe, he managed to demonstrate a way for me to orderly arrange my servo motors (with arrays rather then explicitly listing each servo motors and it&#8217;s individual slot pin). I also learned that when you use the Servo Library, you don&#8217;t have to deal with mounting servo motors on only PWM slots on the Arduino – you can use ANY slot (which in my case was ANY digital slot). Here&#8217;s the code I ended up with:</p>
<pre class="postCode">#include
// an array of instances of the Servo library:
Servo myServos[5];
int incomingByte = 0;  //SETS UP AS ZERO INTERACTION @ START.
int pos = 0;   

void setup() {
 Serial.begin(9600);
 // opens serial port, sets data rate to 9600 bps

 // initialize the servos in the array on pins 2,3,4,5,6
 // servo 0 = pin 2; servo 1 = pin 3, servo 2 = pin 4, servo 3 = pin 5, servo 4 = pin 6
 for (int thisServo = 0; thisServo &lt; 5; thisServo++) {
  int thisPin = thisServo + 2;
  myServos[thisServo].attach(thisPin);
 }

}

void loop() {
  if (Serial.available() &gt; 0) {
   // read the incoming byte:
   incomingByte = Serial.read(); // CHECKS FOR INCOMING SERIAL DATA.

   if(incomingByte == 70) {      // IF INCOMING DATA = 70, REACT.
       // MELODY 68 =  Chime Sequence = 0,5,0,5 = coming home

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {

            myServos[2].write(180); //  servo in array; swing forward in 180 deg.
            delay(500);

            myServos[2].write(100); //  servo in array; swing back 100 deg.
            delay(500);

            myServos[3].write(180);
            delay(500);

            myServos[3].write(100);
            delay(500);

            myServos[1].write(180);
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100);
            delay(500);

           myServos[2].write(180);
            delay(500);

            myServos[2].write(100);
            delay(500);

            myServos[3].write(180);
            delay(500);

            myServos[3].write(100);
            delay(500);

            myServos[1].write(180);
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100);
            delay(500);
            }
       } 

    if(incomingByte == 69) {      // IF INCOMING DATA = 69, REACT.
       // MELODY 68 =  Chime Sequence = 0,5,0,5 = dinner time

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {
            // move to 0 degrees:
            myServos[0].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[0].write(100);
            delay(500);

            myServos[4].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[4].write(100);
            delay(500);

            myServos[0].write(180); // 3rd servo in array; swing forward
            delay(900);
            // move to 0 degrees:
            myServos[0].write(100); // 3rd servo in array; swing back
            delay(900);

            myServos[4].write(180); // first servo in array; swing forward
            delay(900);
            // move to 0 degrees:
            myServos[4].write(100);
            delay(900);

            }
       } 

     if(incomingByte == 68) {      // IF INCOMING DATA = 67, REACT.
       // MELODY 68 =  Chime Sequence = 2,1,0,4,3 = HOLLA

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {
            // move to 0 degrees:
            myServos[2].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[2].write(100);
            delay(500);

            myServos[3].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[3].write(100);
            delay(500);

            myServos[1].write(180); // 3rd servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100); // 3rd servo in array; swing back
            delay(500);

          myServos[2].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[2].write(100);
            delay(500);

            myServos[3].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[3].write(100);
            delay(500);

            myServos[1].write(180); // 3rd servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100); // 3rd servo in array; swing back
            delay(500);
            }
       } 

       if(incomingByte == 67) {      // IF INCOMING DATA = 67, REACT.
         // MELODY 67 =  Chime Sequence = 1,3,1,2,0 = MISSING YOU

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {
            // move to 0 degrees:
            myServos[1].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100);
            delay(500);

            myServos[3].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[3].write(100);
            delay(500);

            myServos[1].write(180); // 3rd servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100); // 3rd servo in array; swing back
            delay(500);

            myServos[2].write(180); // 4th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[2].write(100); // 4th servo in array; swing back
            delay(500);

            myServos[0].write(180); // 5th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[0].write(100); // 5th servo in array; swing back
            delay(500);
            }
       }
             if(incomingByte == 66) {      // IF INCOMING DATA = 65, REACT.
       // MELODY 66 =  Chime Sequence 0, 2, 4, 1, 3 = CONGRATULATIONS

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {
            // move to 0 degrees:
            myServos[0].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[0].write(100);
            delay(500);

            myServos[1].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100);
            delay(500);

            myServos[2].write(180); // 3rd servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[2].write(100); // 3rd servo in array; swing back
            delay(500);

            myServos[3].write(180); // 4th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[3].write(100); // 4th servo in array; swing back
            delay(500);

            myServos[4].write(180); // 5th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[4].write(100); // 5th servo in array; swing back
            delay(500);
            }
      }

    if(incomingByte == 65) {      // IF INCOMING DATA = 65, REACT.
       // MELODY 65 =  Chime Sequence 4,3,2,1,0

            for (int thisServo = 0; thisServo &lt; 1; thisServo++) {
            // move to 0 degrees:
            myServos[4].write(180); // first servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[4].write(100);
            delay(500);

            myServos[3].write(180); // 2nd servo in array; swing back
            delay(500);
            // move to 0 degrees:
            myServos[3].write(100);
            delay(500);

            myServos[2].write(180); // 3rd servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[2].write(100); // 3rd servo in array; swing back
            delay(500);

            myServos[1].write(180); // 4th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[1].write(100); // 4th servo in array; swing back
            delay(500);

            myServos[0].write(180); // 5th servo in array; swing forward
            delay(500);
            // move to 0 degrees:
            myServos[0].write(100); // 5th servo in array; swing back
            delay(500);
            }
       }
    }
  }</pre>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/12/meet-tweetchime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TweetChime in Progress!</title>
		<link>http://pixelpunchout.com/2009/12/tweetchime-in-progress/</link>
		<comments>http://pixelpunchout.com/2009/12/tweetchime-in-progress/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 03:59:51 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[TweetChime]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=556</guid>
		<description><![CDATA[TweetChime in Progress! from cindy wong on Vimeo. I managed to make it work! Here&#8217;s it in action: Five Servomotors using the servo library within Arduino to function within sequence with room for a delay so each servomotor can complete their action before proceeding to the next action. New things I learned: 1) Servo library [...]]]></description>
			<content:encoded><![CDATA[<p><object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=7951263&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7951263&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7951263">TweetChime in Progress!</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>I managed to make it work! Here&#8217;s it in action: Five Servomotors using the servo library within Arduino to function within sequence with room for a delay so each servomotor can complete their action before proceeding to the next action.</p>
<p>New things I learned:</p>
<p>1) Servo library can be used on non-PWM slots on the Arduino. You are not limited by slots 3, 5, 6, 9, 10, 11.</p>
<p>2) Heat shields are a must-have on a voltage regulator where you plan to have your device on for anything above 5 minutes (IMHO)</p>
<p>Photo of my breadboard setup -</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/img_6987.jpg" title="img_6987" rel="lightbox[556]"><img class="alignnone size-medium wp-image-554" title="img_6987" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/img_6987-300x225.jpg" alt="img_6987" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/12/tweetchime-in-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TweetChime Status Report</title>
		<link>http://pixelpunchout.com/2009/12/tweetchime-status-report/</link>
		<comments>http://pixelpunchout.com/2009/12/tweetchime-status-report/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 05:24:41 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=547</guid>
		<description><![CDATA[About a week left before finals are due. Here&#8217;s where I stand: Construction: 90% done. I learned how to use a power drill, the wood shop, and cut saw for all this work! Amazing. Tom Igoe recommended a good way for me to mount my servo motors by using included metal screws with the servo [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/12/photo.jpg" title="photo" rel="lightbox[547]"><img class="alignnone size-full wp-image-548" title="photo" src="http://www.pixelpunchout.com/wp-content/uploads/2009/12/photo.jpg" alt="photo" width="500" height="700" /></a></p>
<p>About a week left before finals are due. Here&#8217;s where I stand:</p>
<p><strong>Construction:</strong> 90% done. I learned how to use a power drill, the wood shop, and cut saw for all this work! Amazing. Tom Igoe recommended a good way for me to mount my servo motors by using included metal screws with the servo motors to these wood planks.  Now, I just need to staple chimes in place, mount a headboard to the front, and plant my arduino and breadboard to the back.</p>
<p><strong>TweetChime Website: </strong>Interaction is in place. Can tweak more with JAVAscript, CSS to make it more pretty but the basic interaction is there. Updated the Twitter parsing so friends and family don&#8217;t have to use previously formatted message (ex: @tweetchime 65 #tweetchime). Now, they can send a brief message that cues the melodies like this: &#8220;@tweetchime [thinking of you]&#8220;.  So far, I have coded messages such as thinking of you, holla, congratulations, and missing you.</p>
<p><strong>Arduino Coding: </strong>Unfortanately, the servo library I was using can only handle up to 3 servomotors. After testing the 4th servo motor, the TweetChime started acting up with servo motors working erratically, out of order, and sometimes randomly without input from my website. Not good. So, I have to redo Arduino coding to use PULSE method (with MILLIS) and not use the servo library. <img src='http://pixelpunchout.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/12/tweetchime-status-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meet TweetChime, ITP Final Project</title>
		<link>http://pixelpunchout.com/2009/11/final-project-for-physical-computing/</link>
		<comments>http://pixelpunchout.com/2009/11/final-project-for-physical-computing/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 05:40:33 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Intro to Computational Media]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[TweetChime]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=486</guid>
		<description><![CDATA[For my Final Project, I decided to combine my ICMW and PComp classes together and produce a single idea: Meet TweetChime. TweetChime is an interactive music chime that  that will take specially coded Twitter messages people send to you and transforms them into melody where you are. What makes that so special? Whether a friend [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/pcompgraphic1.jpg" title="pcompgraphic1" rel="lightbox[486]"><img class="alignnone size-large wp-image-543" title="pcompgraphic1" src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/pcompgraphic1-1024x568.jpg" alt="pcompgraphic1" width="563" height="301" /></a></p>
<p>For my Final Project, I decided to combine my ICMW and PComp classes together and produce a single idea: Meet <a href="http://itp.nyu.eud/~cw1028/pcomp/tweetchime.html" target="_blank">TweetChime</a>. TweetChime is an interactive music chime that  that will take specially coded Twitter messages people send to you and transforms them into melody where you are. What makes that so special?</p>
<p>Whether a friend wants to express &#8220;Good Luck!&#8221;, &#8220;Congratulations!&#8221;, &#8220;Have a Great Day&#8221; or &#8220;Thinking Of You&#8221;, TweetChime transforms their greeting in a harmonious patterned musical chime melody in real time. Be pleasantly surprised when you hear the ringing of notes and know that someone – out there– is thinking of you. As an owner, you can decipher what people are messaging you based on the musical melody overheard.</p>
<p><strong>Interaction: </strong>Person tweets a message through a special code setup. Example: <em>@cwong08 says, &#8220;@tweetchime 65 #tweetchime.</em><br />
Among the selected messages are examples like &#8220;Have a Good Day!&#8221; &#8220;Miss You,&#8221; &#8220;Good Luck!&#8221;, &#8220;I Love You,&#8221; that are given specific number codes etc. Currently, numbers 65-68 are coded. The owner of the TweetChime machine will log on to the <a href="http://itp.nyu.eud/~cw1028/pcomp/tweetchime.html" target="_blank">TweetChime</a> website and activate their device. From there, the TweetChime website scans an RSS feed for impending tweets  for @tweetchime and refreshes your website with appropriate melody when triggered by friends and family&#8217;s tweets.</p>
<p><strong>Under the Hood:</strong> TweetChime is powered by Javascript, PHP, and an Arduino. The <a href="http://itp.nyu.eud/~cw1028/pcomp/tweetchime.html" target="_blank">TweetChime</a> website is built with Javascript to interact serially with the Arduino (via USB port). <a href="http://itp.nyu.eud/~cw1028/pcomp/tweetchime.html" target="_blank">TweetChime </a> website uses AJAX to scoop data from a PHP script that reads a Twitter RSS feed and parses numerical codes from people&#8217;s submitted tweets.  From there, it passes those byte values to the Arduino which then outputs it into the message&#8217;s cued  melody.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/pcompmotorlayout1.jpg" title="pcompmotorlayout1" rel="lightbox[486]"><img class="alignnone size-full wp-image-533" title="pcompmotorlayout1" src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/pcompmotorlayout1.jpg" alt="pcompmotorlayout1" width="500" height="500" /></a></p>
<p><strong>Setup</strong>: Arduino, PHP, Javascript, 5 wind chime tubes, servo motors, 5 mini metal tubes (strikers)</p>
<p>Each wind chime is paired with a servo motor that is wired to the Arduino.  When the Arduino checks for digital read messages, it will receive the values and trigger the servo motor to tap the chime in series. A message like &#8220;Have a Good Day!&#8221; would sound differently then a message like &#8220;Miss You.&#8221;</p>
<p>Here&#8217;s a video of me testing the sensor motors against the wind chimes I purchased to see if they&#8217;d resonate.<br />
<object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=7676984&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7676984&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7676984">Testing Servo Motor for Final Project Use</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><object width="500" height="281" data="http://vimeo.com/moogaloop.swf?clip_id=7780825&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7780825&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7780825">Testing Prototype: TweetChime Web/ServoMotor Interaction</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><object width="500" height="281" data="http://vimeo.com/moogaloop.swf?clip_id=7790314&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7790314&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7790314">Physical Construction of TweetChime</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/11/final-project-for-physical-computing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week 8 Lab: Transistor Lab + HBridge Lab</title>
		<link>http://pixelpunchout.com/2009/11/week-8-lab-transistor-lab-hbridge-lab/</link>
		<comments>http://pixelpunchout.com/2009/11/week-8-lab-transistor-lab-hbridge-lab/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 05:32:16 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=473</guid>
		<description><![CDATA[This series of labs were a two-part process. First, we had to learn how to control a DC motor which uses a high current load.  Then, we used H-bridges to control the spin direction of the DC motor. Transistor Lab Using DC Motor with Arduino from cindy wong on Vimeo. So how do you control a high-current [...]]]></description>
			<content:encoded><![CDATA[<p>This series of labs were a two-part process. First, we had to learn how to control a DC motor which uses a high current load.  Then, we used H-bridges to control the spin direction of the DC motor.</p>
<p><strong>Transistor Lab</strong><br />
<object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=7407363&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7407363&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7407363">Using DC Motor with Arduino</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>So how do you control a high-current DC load such as a DC motor? Transistors, in this case the  TP120 transistor which acts as an electrical switch between the Arduino and power to make the higher current load (in current, voltage)doesn&#8217;t overwhelm it. In this scenario, I used a potentiometer to control the spin intensity of the DC Motor. FYI, I learned that soldering a DC motor is easy since the order of the wires, power or ground, doesn&#8217;t matter! Check out the video above.</p>
<p>Update: Note that clickety, jerky motion of the DC motor above? Apparently, that is the result of the DC motor receiving too much power. Looks like that DC Motor is meant to run between 3-5V power. The Arduino is blinking (resetting itself) each time as an indicator for us (according to Igoe).</p>
<p>Here&#8217;s the Breadboard setup.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_9913.jpg" title="img_9913" rel="lightbox[473]"><img class="alignnone size-medium wp-image-475" title="img_9913" src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_9913-300x225.jpg" alt="img_9913" width="300" height="225" /></a></p>
<p><span id="more-473"></span></p>
<p><strong>DC Motor Control Lab</strong></p>
<p><strong></strong><br />
<object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=7446936&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7446936&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7446936">H-Bridge to control DC Motor Spin on Arduino</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>To change the direction of the DC Motor&#8217;s spin, you&#8217;ll need an H-bridge which connects to your breadboard. The H-bridge is handy when you want to control multiple motors. In this case, we&#8217;re controlling the circuitry by alternating power between the H-bridge&#8217;s motor logic pins which are connected to digital pins on the Arduino. Sending power HIGH or LOW changes the motor&#8217;s spin direction from one way to the other. See the bread board below.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_3043.jpg" title="img_3043" rel="lightbox[473]"><img class="alignnone size-medium wp-image-476" title="img_3043" src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_3043-300x225.jpg" alt="img_3043" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/11/week-8-lab-transistor-lab-hbridge-lab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Midterm Project: Etch Yo Sketch Machine</title>
		<link>http://pixelpunchout.com/2009/11/midterm-project-etch-yo-sketch-machine/</link>
		<comments>http://pixelpunchout.com/2009/11/midterm-project-etch-yo-sketch-machine/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 04:34:50 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=435</guid>
		<description><![CDATA[For the Physical Computing midterm, Rune Madsen, Benji Canning Pereira, and myself  decided to focus on a whimsical, fun project. Using Arduino and Processing, Etch Yo Sketch is a digital twist on the nostalgic kid&#8217;s toy, Etch-a-Sketch. Rather then focusing solely on software, we wanted to mimic the tactile feel and imaginative play in an [...]]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="300" data="http://blip.tv/play/AYGsuQwC" type="application/x-shockwave-flash"><param name="src" value="http://blip.tv/play/AYGsuQwC" /><param name="allowfullscreen" value="true" /></object></p>
<p>For the Physical Computing midterm, <a href="http://www.runemadsen.com/itp" target="_blank">Rune Madsen</a>, <a href="http://itp.nyu.edu/~bcp241/blog" target="_blank">Benji Canning Pereira</a>, and myself  decided to focus on a whimsical, fun project. Using Arduino and Processing, Etch Yo Sketch is a digital twist on the nostalgic kid&#8217;s toy, Etch-a-Sketch. Rather then focusing solely on software, we wanted to mimic the tactile feel and imaginative play in an old-school format – so we constructed &#8220;Etch Yo Sketch&#8221; within an arcade-machine setup. Underneath the arcade machine is a Mac Book Pro reading the serial communication between our sensors and an Arduino which is displayed on screen.</p>
<p><strong>Play Interaction:</strong></p>
<p>Twirl the 360-degree Potentiometers to draw lines along the screen canvas. Twist the regular potentiometers to select your choice of color for the lines. Hit the reset button to restart from scratch. Hit the upload button to see your work saved and presented on our <a href="http://www.runemadsen.com/etchyosketch">Etch Yo Sketch gallery</a>. Watch the Making of Etch Yo Sketch, below.</p>
<p><span id="more-435"></span><strong></strong></p>
<p><strong>Physical Setup + Troubleshooting:</strong></p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_9905.jpg" title="Etch Yo Sketch " rel="lightbox[435]"><img class="alignnone size-medium wp-image-462" title="Etch Yo Sketch " src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_9905-300x225.jpg" alt="Etch Yo Sketch " width="300" height="225" /></a></p>
<p>We knew right off that we wanted to mimic a physical interface similar to the Etch A Sketch. At first, we thought to make a wood box. However, after testing a cardboard box as an initial prototype,  we discovered that the Mac Book Pro was a perfect fit for this design. We nestled insulating foam to provide cushion and prevent shifting. We outlined the box to conform to an arcade machine, sculpted it out, and made room for the computer screen. Felt is used for exterior decoration and controller display.</p>
<p>With five Potentiometers, two buttons, we found wiring the breadboard to be nightmarish. Certain wires wouldn&#8217;t stay plugged to the breadboard and would come undone easily. Plus, it was visually confusing with wires for Analog In, Ground, Power mixing around.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_99022.jpg" title="img_99022" rel="lightbox[435]"><img class="alignnone size-medium wp-image-465" title="img_99022" src="http://www.pixelpunchout.com/wp-content/uploads/2009/11/img_99022-300x225.jpg" alt="img_99022" width="300" height="225" /></a></p>
<p><em>Solution: </em>To ensure security and organization to the breadboard, we soldered the wires to a row of headers so they would stick. One row was dedicated to inputs (buttons, potentiometers), two other rows were dedicated to Power Source (ground, power).  Don&#8217;t forget to snick off the headers not being used so you don&#8217;t get confused.</p>
<p><strong>Software Setup + Troubleshooting</strong></p>
<p>The hardware of the Etch Yo Sketch was designed to mimic the actual Etch A Sketch. Therefore, we needed our Processing software to interpret readings from the 360-degree pots we used for the drawing knobs. Regular potentiometers go in value from 0 to 1023 bytes and crank to about 300 degrees. How do we take into account a Potentiometer that can whirl around 360 degrees? Twirled continuously, the 360-degree pots repeated the values 0-1023 bytes over and over.</p>
<p>How could Processing interpret those values? How would it affect our Processing sketch? Left alone, on the Processing Sketch, a plotted line would appear glitchy, repeating and skitting across the screen as certain values were repeating.</p>
<p><em>Solution</em>: We wanted the lines to move steadily in the same direction without glitches. In Processing, you would save the last value of the 360-degree potentiometer sensor, read the new value from the pot sensor, and subtract  the new value from the previous value (Old value &#8211; New value = Difference in values). By taking the difference in values, you can use that measurement to move the line in a continuously smooth fashion. What happens if you go from a value of 1023 back to 0? In Processing, an IF statement would be triggered: if the difference in values (from the old pot reading &#8211; new pot reading), was greater then 500, that difference would be subtracted from 1023 (1023-difference in value readings).</p>
<p><em>Another dilemma: </em>When drawing with potentiometers, keep this in mind. Sometimes, the numbers generated will flicker if you check them in Serial Monitor or in Processing. To eliminate the glitchy numbers, in Processing, we only used the differences if the value was greater then 1 or lower than 1).</p>
<p><strong><a href="http://www.runemadsen.com/etchasketch_redo2.zip">Etch Yo Sketch Processing Sketch</a></strong></p>
<p><strong>Arduino Setup:</strong></p>
<p><span style="font-family: 'Courier New', monospace; line-height: 18px; font-size: 12px; white-space: pre;">/*************** VARIABLES **************/</span></p>
<pre class="postCode">int leftRightPot = 0;
int upDownPot = 1;
int rPot = 2;
int gPot = 3;
int bPot = 4;

int resetButton = 2;
int uploadButton = 3;

int theValue = 0; 

/*************** SETUP **************/

void setup()
{
     Serial.begin (9600); // set up the communication between Arduino + PC
     pinMode(resetButton, INPUT); // define button for INPUT
     pinMode(uploadButton, INPUT); // define button for INPUT

}

/*************** CODE IN ACTION **************/

void loop()
{
    theValue = analogRead(leftRightPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = analogRead(upDownPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = analogRead(rPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = analogRead(rPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = analogRead(gPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = analogRead(bPot); // puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

    theValue = digitalRead(resetButton); // DIGITAL button: puts the values within the variable
    Serial.print(theValue, DEC); // print the values in DEC format (#s)
    Serial.print(","); // adds a comma to separate series of number readings

   theValue = digitalRead(uploadButton); // DIGITAL BUTTON: puts the values within the variable
    Serial.println(theValue, DEC); // print line: last line of code should end the code so it can restart a new set of values.

}</pre>
<p><strong>Recommendations:</strong></p>
<p>1) TEST ALL YOUR WIRES/SETUP initially before you get fully invested in your idea. That helps you head off bad wiring issues that may crop up later i you don&#8217;t carefully think of how to organize your breadboard setup.</p>
<p>2) Experiment with new sensors before diving into a project – that&#8217;ll let you know right away whether an idea is executable. We almost went without the 360-degree pots because of the values they generated &#8212; which Rune was able to troubleshoot.</p>
<p>3) Test first with a rough prototype before cutting precious supplies. Make a paper pattern or prototype if possible. We found we were able to see ideas quickly and execute them by testing with cardboard rather then using the woodshop supplies.</p>
<p>4) Fabric Glue + Duct Tape = No fuss mockups. Felt covered alot of our pComp sins.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/11/midterm-project-etch-yo-sketch-machine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Observation of  Interactive Technology: MetroCard Ticket Machine</title>
		<link>http://pixelpunchout.com/2009/10/observation-of-interactive-technology-metrocard-ticket-machine/</link>
		<comments>http://pixelpunchout.com/2009/10/observation-of-interactive-technology-metrocard-ticket-machine/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 04:52:26 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=388</guid>
		<description><![CDATA[For my observation study, I decided to choose a common device that millions of people use in New York daily — the MTA ticket machine. The MTA ticket machine handles dispensing new subway ticket cards, card renewals, and checking ticket balances. My observation took place at the R/Q/W train stop on NYU/8th St. Around 5PM, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2957.jpg" title="img_2957" rel="lightbox[388]"><img class="alignnone size-large wp-image-389" title="img_2957" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2957-1024x768.jpg" alt="img_2957" width="500" height="368" /></a></p>
<p>For my observation study, I decided to choose a common device that millions of  people use in New York daily — the MTA ticket machine.<br />
The MTA ticket machine handles dispensing new subway ticket cards, card renewals, and checking ticket balances. My observation took place at the R/Q/W train stop on NYU/8th St. Around 5PM, I saw a small mix of mostly New Yorkers with a tourist or two.<br />
Most interactions appeared to be New Yorkers buying new cards. The tourists also appeared to buy new cards. I stayed about 5-10 feet away to be unobtrusive so I wasn&#8217;t able to see which type of cards were bought.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2953.jpg" title="img_2953" rel="lightbox[388]"><img class="alignnone size-medium wp-image-390" title="img_2953" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2953-300x225.jpg" alt="img_2953" width="300" height="225" /></a></p>
<p>After selecting the language screen, most users punch which type of card to get. The regular subway riders took about 10 seconds to finish a transaction when it came to selecting a new card, paying, and retrieving a fresh MTA subway card. This is with the understanding that most purchase the 1-Month, MTA card since the other cards seem to cater to visitors rather then residents. So, if you were a tourist or a new resident and wanted an unlimited pass (whether for 1-day, 7-day, or for a month) where would you go? There&#8217;s no real indication on the main page, above. You just have to click on METROCARD above where you see below your options.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2954.jpg" title="img_2954" rel="lightbox[388]"><img class="alignnone size-medium wp-image-391" title="img_2954" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2954-300x225.jpg" alt="img_2954" width="300" height="225" /></a></p>
<p>Still can&#8217;t find that 30-day, 7-day, 14-day unlimited ride pass? If you select, Get New Card, you are asked to select among 1-Day card, 7-Day, 14-Day or 30-Day Unlimited Ride MetroCard. Why is this buried? The few tourists I did see hesitate when looking at this selection. Why does the first page on the MetroCard kiosk offer:  Pay $8, Get 4 Rides Free, MetroCard, or Single Fare? What does Pay $8, Get 4 Rides Free mean to the average tourist who probably is unaware of a single fare?</p>
<p>Based on the massive amount of New York tourism, it makes sense to make the first screen offer: Single Ride, 1-Day card, 7-Day, 14-Day or 30-Day Unlimited Ride MetroCard. On a smaller button, they should offer sub-services like refill cards, etc. While the MetroCard kiosk offers a variety of payment options, the physical payment interface is color coded separately for credit/debit payment (coded in blue) vs. money payment (coded in green). Why the separation? The payment information should be located in the same vicinity to avoid confusion. The tourists added on their transaction times by about 30-40 seconds more, taking time to read, double check purchase information, and confirm their cards before walking away.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2955.jpg" title="img_2955" rel="lightbox[388]"><img class="alignnone size-medium wp-image-392" title="img_2955" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2955-300x225.jpg" alt="img_2955" width="300" height="225" /></a></p>
<p>Under a sub-menu, you  can chose to add credits to your existing MetroCard. So far, I have not and still haven&#8217;t seen anyone use that feature intentionally. The person photographed at the top mistakenly selected this feature and pressed back to the main menu. Furthermore, there&#8217;s no indication on the Refill MetroCard on how much money generates how many fare trips the passenger can take. It would be helpful if a diagram (on the outside) or on the screen indicates: $20 = 10 Rides. $10 = 5 Rides, etc. Also, the machine assumes you know where to insert your card to refill. Some people could spend time searching where. A helpful color-coded (yellow for MTA card) arrow pointing in the general direction could help.</p>
<p>Overall, I think the physical interface for the MetroCard kiosk does a good job of communicating certain areas for ticket buyers with color coding. However, I think the screen interface for the MetroCard system needs a redesign so that purchase ticket times can be reduced.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/10/observation-of-interactive-technology-metrocard-ticket-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serial Out with Arduino (Javascript Edition)</title>
		<link>http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/</link>
		<comments>http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 02:27:18 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Intro to Computational Media]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=346</guid>
		<description><![CDATA[For this lab assignment, I learned how to set up an interaction between my Arduino and my computer.  This is called serial communication.  I hooked up a variable resistor, my pentiometer, to my breadboard. From there, I set up my USB between my computer and  Arduino. Data from my pentiometer travels to the Arduino who [...]]]></description>
			<content:encoded><![CDATA[
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-17/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-17-150x150.png" class="attachment-thumbnail" alt="picture-17" title="picture-17" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-14/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-14-150x150.png" class="attachment-thumbnail" alt="picture-14" title="picture-14" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-13/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-13-150x150.png" class="attachment-thumbnail" alt="picture-13" title="picture-13" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-11-2/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-11-150x150.png" class="attachment-thumbnail" alt="picture-11" title="picture-11" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-10/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-10-150x150.png" class="attachment-thumbnail" alt="picture-10" title="picture-10" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-16/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-16-150x150.png" class="attachment-thumbnail" alt="picture-16" title="picture-16" /></a>
<a href='http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/picture-15/' ><img width="150" height="150" src="http://pixelpunchout.com/wp-content/uploads/2009/10/picture-15-150x150.png" class="attachment-thumbnail" alt="picture-15" title="picture-15" /></a>

<p>For this lab assignment, I learned how to set up an interaction between my Arduino and my computer.  This is called serial communication.  I hooked up a variable resistor, my pentiometer, to my breadboard. From there, I set up my USB between my computer and  Arduino. Data from my pentiometer travels to the Arduino who transmits it to my computer to display in a visual interface on my web browser (via a Javascript applet).  This Javascript applet graphs my sensor&#8217;s output corresponding with my action with my pentiometer . See the screenshots above from multiple takes.</p>
<p>FYI:</p>
<p>Prof. Shawn Van Every created the<a href="http://www.walking-productions.com/jsserial/new/JSSerial.html" target="_blank"> Javascript application</a>. Links and installation steps <a href="http://www.walking-productions.com/jsserial/new/JSSerial.html" target="_blank">here</a>.</p>
<p>Tip: When it comes to sensing your data over  serial communication, it&#8217;s a good idea to troubleshoot your setup. On my Arduino, I input this code below:</p>
<pre><span style="color: #cc6600;">int</span> analogPin = 0;
 <span style="color: #cc6600;">int</span> analogValue = 0;

 <span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><strong>setup</strong></span>()
 {
   <span style="color: #7e7e7e;">// start serial port at 9600 bps:</span>
   <span style="color: #cc6600;">Serial</span>.<span style="color: #cc6600;">begin</span>(9600);
 }

 <span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><strong>loop</strong></span>()
 {
   <span style="color: #7e7e7e;">// read analog input, divide by 4 to make the range 0-255:</span>
   analogValue = <span style="color: #cc6600;">analogRead</span>(analogPin);
   analogValue = analogValue / 4;
   <span style="color: #cc6600;">Serial</span>.<span style="color: #cc6600;">print</span>(analogValue, <span style="color: #006699;">BYTE</span>);
   <span style="color: #7e7e7e;">// pause for 10 milliseconds:</span>
   <span style="color: #cc6600;">delay</span>(10);
 }</pre>
<p>From there, I check my serial monitor to see the ASCII characters in play when I twist my pentiometer. I, then modify the code from BYTE to DEC to see the numerical values. Is it working? Yes?</p>
<p>Problems Encountered: Faulty/Buggy Javascript app code that was later modified by Prof Shawn + that later allowed me to show the different feedback results from my Pentiometer test.</p>
<p>REVISED: Prof. Shawn Van Every released an updated version of Javascript applet here that is much more sensitive to the Arduino output. <a href="http://www.walking-productions.com/jsserial/new/new_serial_graph.html" target="_blank">New Serial Graph link.</a></p>
<p>Future tip: If I plan to do any visual display work with Javascript and Arduino, I need to include  the following files: <a href="http://www.walking-productions.com/jsserial/new/JSSerial.jar">JSSerial.jar</a> and <a href="http://www.walking-productions.com/jsserial/new/jsserial-applet.jnlp">jsserial-applet.jnlp</a> along with my HTML/JavaScript.</p>
<p>For ICM Web, we had to create our own Javascript web applet. Here&#8217;s my output with my pentiometer.<br />
<object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=7148797&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7148797&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/7148797">Serial Communication with the Arduino</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: medium; line-height: normal; font-size-adjust: none; font-stretch: normal;">&lt;pre class=&#8221;postCode&#8221;&gt;</span></p>
<pre id="line1">&lt;<span class="start-tag">html</span>&gt;
	&lt;<span class="start-tag">head</span>&gt;
		&lt;<span class="start-tag">title</span>&gt; Serial Communication: Experimenting with Pentiometer, Loops &lt;/<span class="end-tag">title</span>&gt;
		<span class="comment">&lt;!-- Change Colors --&gt;</span>

		&lt;<span class="start-tag">style</span><span class="attribute-name"> type </span>=<span class="attribute-value"> "text/css"</span>&gt;

		body	{
		font-family: Arial Black, Arial, Helvetica, Sans-Serif;
		font-size: 55pt;
		}

		#body	{
		background-color: #000000; /* starts black */
		}

		&lt;/<span class="end-tag">style</span>&gt;

&lt;<span class="start-tag">script</span><span class="attribute-name"> type </span>=<span class="attribute-value"> "text/javascript"</span>&gt;

		function initVars()
			{
				thecolordiv = document.getElementById("colordiv"); //swap words
			}
		function openPort()
		{
		document.JSSerial.startSerial("/dev/tty.usbserial-A6008nhi");
		//hardwires the USB serial port connection 

		//myinterval = setInterval("readSerial()",5);
		//sets Interval delay, PC delay has to be faster then Arduino code delay

		startTimer();
		}

		function startTimer()
		// function to kick off timer.
		{
			var timer = setInterval("timerran()",5);
			//PC has shorter delay then Arduino
		}

		function timerran()
		{
			//tests if data is available
			if (document.JSSerial.available() &gt; 0)
			{
				//var outputdivtimer = document.getElementById("outputdivtimer");
				//turns it into a variable

				// reads the sensor's bytes from the serial port
				var inByte = document.JSSerial.last();

				// write sensor values (bytes) to the output div
				//outputdivtimer.innerHTML = inByte;

	// pseudo code time!

			if ((inByte &gt;= 0) &amp;&amp; (inByte &lt; 50))
			{
			// Change the "style" of the body and set the background color to red
			document.body.style.backgroundColor = "#FF0000";
			colordiv.innerHTML = "RED";
			//SAY RED, CHANGE TO RED
			}

			if ((inByte &gt;= 50) &amp;&amp; (inByte &lt; 60))
			{
			document.body.style.backgroundColor = "#FF3300";
			colordiv.innerHTML = "ORANGE";
			//say ORANGE, TURN ORANGE
			}

 			if ((inByte &gt;= 60) &amp;&amp; (inByte &lt; 70))
 			{

 			document.body.style.backgroundColor = "#FFCC00";
			colordiv.innerHTML = "YELLOW";
			//say YELLOW, TURN YELLOW
 			}

 			if ((inByte &gt;= 70) &amp;&amp; (inByte &lt; 80))
 			{
 			document.body.style.backgroundColor = "#99FF00";
			colordiv.innerHTML = "GREEN";
 			// say GREEN, TURN GREEN
 			}

			if ((inByte &gt;= 80) &amp;&amp; (inByte &lt; 90))
			{
			document.body.style.backgroundColor = "#00CCFF";
			colordiv.innerHTML = "BLUE";
			// say BLUE, turn BLUE
			}

			if ((inByte &gt;= 90) &amp;&amp; (inByte &lt; 100))
			{
			document.body.style.backgroundColor = "#6600CC";
			colordiv.innerHTML = "PURPLE";
			// say PURPLE, turn PURPLE
			}

			if ((inByte &gt;= 100) &amp;&amp; (inByte &lt;110))
			{
			document.body.style.backgroundColor = "#666666";
			colordiv.innerHTML = "GRAY";
			//say GRAY, turn GRAY
			}

			if ((inByte &gt;= 110) &amp;&amp; (inByte &lt; 127))
			{
			document.body.style.backgroundColor = "#000000";
			colordiv.innerHTML = "BLACKNESS";
			// say BLACK, turn BLACK
			}
		}
		}
&lt;/<span class="end-tag">script</span>&gt;
&lt;/<span class="end-tag">head</span>&gt;</pre>
<pre id="line122">
&lt;<span class="start-tag">body</span><span class="attribute-name"> onload</span>=<span class="attribute-value">"initVars()"</span>&gt;
		<span class="comment">&lt;!-- The Applet which provides serial port access, should be in the body --&gt;</span>
		&lt;<span class="start-tag">script</span><span class="attribute-name"> src</span><span>="</span><a href="view-source:http://www.java.com/js/deployJava.js">http://www.java.com/js/deployJava.js</a><span>"</span>&gt;&lt;/<span class="end-tag">script</span>&gt;
		&lt;<span class="start-tag">script</span>&gt;
			var attributes = { code:'JSSerial.class', archive:'JSSerial.jar',  width:1, height:1, id:'JSSerial'};
			var parameters = {jnlp_href: 'jsserial-applet.jnlp'};
			deployJava.runApplet(attributes, parameters, '1.5');
		&lt;/<span class="end-tag">script</span>&gt;

		<span class="comment">&lt;!-- Done with the applet --&gt;</span>

<span class="comment">&lt;!-- START Button IGNITES COLOR CHANGE CONTROLLED BY POT VALUES --&gt;</span>
&lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"button" </span><span class="attribute-name">name</span>=<span class="attribute-value">"start me up" </span><span class="attribute-name">value</span>=<span class="attribute-value">"start" </span><span class="attribute-name">onclick</span>=<span class="attribute-value">"openPort()"</span><span class="attribute-name">;</span>&gt;</pre>
<pre id="line137"><span class="comment">&lt;!-- Serial Read Output:
&lt;div id="outputdivtimer"&gt; &lt;/div&gt; --&gt;</span> 

&lt;<span class="start-tag">h1</span>&gt; Color Output: &lt;/<span class="end-tag">h1</span>&gt;
&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value"> "colordiv"</span>&gt; Black &lt;/<span class="end-tag">div</span>&gt;

&lt;/<span class="end-tag">body</span>&gt;
&lt;/<span class="end-tag">html</span>&gt;</pre>
<p>&lt;/pre&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/10/serial-out-with-arduino-javascript-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stupid Pet Trick: ITP Voo Doo Doll</title>
		<link>http://pixelpunchout.com/2009/10/stupid-pet-trick-itp-voo-doo-doll/</link>
		<comments>http://pixelpunchout.com/2009/10/stupid-pet-trick-itp-voo-doo-doll/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 03:23:28 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=326</guid>
		<description><![CDATA[Meet the ITP Voo Doo Doll, a creation inspired for the Physical Computingignment – the Stupid Pet Trick. That&#8217;s right, my professor, Tom Igoe, wanted us to demonstrate our knowledge via a gimmicky blinky, bleepy schtick. Thus the name, Stupid Pet Trick. Physical Computing: ITP Voo Doo Doll in Action from cindy wong on Vimeo. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2898.jpg" title="img_2898" rel="lightbox[326]"><img class="alignnone size-medium wp-image-327" title="img_2898" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2898-300x225.jpg" alt="img_2898" width="500" height="425" /></a></p>
<p>Meet the ITP Voo Doo Doll, a creation inspired for the Physical Computingignment – the Stupid Pet Trick. That&#8217;s right, my professor, Tom Igoe, wanted us to demonstrate our knowledge via a gimmicky blinky, bleepy schtick. Thus the name, Stupid Pet Trick.</p>
<p><object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=6939663&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=6939663&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/6939663">Physical Computing: ITP Voo Doo Doll in Action</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Since ITP is throwing a Halloween Haunted House, I decided to stick (pun intended) to the gothic theme. Right now, I&#8217;m nicknaming my ITP Voo Doo Doll, Mr. Arduino. During these stressful weeks of grad school, it&#8217;s been a  very therapeutic toy shall we say. Stab, stab, stab.</p>
<p><em>What&#8217;s it made of?</em></p>
<p>Black felt, steel wool, insulation padding, 22-gauge wires, 2 alligator clips.</p>
<p><em>How does it work? </em></p>
<p>Stick a needle in the Voo Doo Doll and it starts blinking and sounding off crazy beeps. Sensor-wise: I turned the doll into the sensor itself. Inside is two pads of steel wool wrapped in insulation. Clipped to them are alligator clips wired back to the breadboard. The action of stabbing the doll with a metal needle acts as a conduit to turning the switch (doll) ON, completing the electrical circuit.</p>
<p>Here&#8217;s my initial test video where I&#8217;m making sure the concept works.<br />
<object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=6888524&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=6888524&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p><a href="http://vimeo.com/6888524">ITP Voo Doo Doll</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><em>Code?</em></p>
<p>At this moment, I don&#8217;t have my Arduino code available since my computer crashed shortly after I finished the project (eerie, right?). When I recover my hard drive, I&#8217;ll see if I can get it out on to this blog.</p>
<p>At the moment, here&#8217;s a setup of my breadboard.</p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2896.jpg" title="img_2896" rel="lightbox[326]"><img class="alignnone size-medium wp-image-328" title="img_2896" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2896-300x225.jpg" alt="img_2896" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/10/stupid-pet-trick-itp-voo-doo-doll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PComp Week 4: Servo Motor Control, Tone Output with Arduino</title>
		<link>http://pixelpunchout.com/2009/10/pcomp-week-4-servo-motor-control-tone-output-with-arduino/</link>
		<comments>http://pixelpunchout.com/2009/10/pcomp-week-4-servo-motor-control-tone-output-with-arduino/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 07:40:00 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>

		<guid isPermaLink="false">http://www.pixelpunchout.com/?p=320</guid>
		<description><![CDATA[First Lab: Servo Motor Control with Arduino. Program an Arduino to make motion with a microcontroller called servo motor. The Arduino controlls the servomotor&#8217;s position with values returned from an analog sensor. Disclaimer : Having no prior mechanical/tinkering knowledge prior to ITP, I was absolutely clueless to how to assemble the dissembled Servo Motor that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2857.jpg" title="img_2857" rel="lightbox[320]"><img class="alignnone size-medium wp-image-321" title="img_2857" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2857-300x225.jpg" alt="img_2857" width="500" height="425" /></a></p>
<p><strong>First Lab: Servo Motor Control with Arduino.<br />
</strong><br />
Program an Arduino to make motion with a microcontroller called servo motor. The Arduino controlls the servomotor&#8217;s position with values returned from an analog sensor.</p>
<p><em>Disclaimer</em> : Having no prior mechanical/tinkering knowledge prior to ITP, I was absolutely clueless to how to assemble the dissembled Servo Motor that came with my NYU lab parts kit. Instructions, please! Apparently, I spent nearly 2 hours thinking I had a coding or hardware issue that prevented me from completing this lab properly. The cause of misery? A servo motor whose top propeller head was attached too &#8220;loosely&#8221; to the screw and prevented it from circling it&#8217;s top.</p>
<p>Lesson learned: Set up the breadboard like a conventional circuit layout. Connected an analog input sensor (force sensor seen above) to Analog Pin 0 and a servo motor to Digital Pin 2. Don&#8217;t forget to supply the Servo Motor with a resistor and access to power bus row.</p>
<p><span id="more-320"></span><strong>Coding: Had to learn the Pulse Method first before seeing the tidy Arduino coding that obscures the calculations under the hood.</strong></p>
<p>/*</p>
<p>Servo control from an analog input</p>
<p>The minimum (minPulse) and maxiumum (maxPulse) values will be different depending on your specific servo motor.</p>
<p>Ideally, it should be between 1 and 2 milliseconds, but in practice, 0.5 &#8211; 2.5 milliseconds works well for me. Try different values to see what numbers are best for you.</p>
<p>This program uses the millis() function to keep track of when the servo was last pulsed.  millis() produces an overflow error (i.e. generates a number</p>
<p>that&#8217;s too big to fit in a long variable) after about 5 days. if you&#8217;re making a program that has to run for more than 5 days, you may need to</p>
<p>account for this.</p>
<p>/*  by Tom Igoe</p>
<p>additions by Carlyn Maw &amp; Rob Faludi</p>
<p>Created 28 Jan. 2006</p>
<p>Updated 10 Jun. 2008</p>
<p>*/</p>
<p>int servoPin = 2;     // Control pin for servo motor</p>
<p>int minPulse = 500;   // Minimum servo position</p>
<p>int maxPulse = 2500;  // Maximum servo position</p>
<p>int pulse = 0;        // Amount to pulse the servo</p>
<p>long lastPulse = 0;    // the time in milliseconds of the last pulse</p>
<p>int refreshTime = 20; // the time needed in between pulses</p>
<p>int analogValue = 0;  // the value returned from the analog sensor</p>
<p>int analogPin = 0;    // the analog pin that the sensor&#8217;s on</p>
<p>void setup() {</p>
<p>pinMode(servoPin, OUTPUT);  // Set servo pin as an output pin</p>
<p>pulse = minPulse;           // Set the motor position value to the minimum</p>
<p>Serial.begin(9600);</p>
<p>}</p>
<p>void loop() {</p>
<p>analogValue = analogRead(analogPin);      // read the analog input</p>
<p><strong>pulse = map(analogValue,0,1023,minPulse,maxPulse);    // convert the analog value</strong></p>
<p><strong> // to a range between minPulse</strong></p>
<p><strong> // and maxPulse.</strong></p>
<p>// pulse the servo again if rhe refresh time (20 ms) have passed:</p>
<p>if (millis() &#8211; lastPulse &gt;= refreshTime) {</p>
<p>digitalWrite(servoPin, HIGH);   // Turn the motor on</p>
<p>delayMicroseconds(pulse);       // Length of the pulse sets the motor position</p>
<p>digitalWrite(servoPin, LOW);    // Turn the motor off</p>
<p>lastPulse = millis();           // save the time of the last pulse</p>
<p>}</p>
<p>}</p>
<div>Here&#8217;s in <a href="http://itp.nyu.edu/physcomp/Labs/Servo" target="_blank">Tom&#8217;s</a> lab notes: &#8220;This code was written with a potentiometer in mind, so it assumes you&#8217;re going to get values from 0 to 1023 from the sensor. If you don&#8217;t, the servo won&#8217;t move through its whole range. Determine the range of numbers the sensor is giving you and adjust the servo formula to fit. To fix this, use the map() function. You know the input range is the range of the sensor, 0 to 1023. And you know the output range is from minPulse to maxPulse.</div>
<div>Anyhoo, here&#8217;s the shorthand code.</div>
<div>
<div>/*</div>
<div>Servo control from an analog input using the Arduino Servo library. This example code uses the Arduino Servo library which comes packaged with the Arduino software. In order to make this work, you must include the Servo.h library file, create an instance of the Servo object.</div>
<div>attach a pin to the Servo object, and then write an analog value to the Servo object to set its</div>
<div>position.</div>
<div>T<em>he difference between using the Servo library and the older method of pulsing a digital pin is that the library</em></div>
<div><em> handles a lot of the work for you. You no longer need to figure out the translation between pulse length and position. </em></div>
<div>You now can simply specify the angle you&#8217;d like your servo to be at and it will turn to that position.</div>
<div>*/</div>
<div>Updated 08 Sep 2009</div>
<div>by Rory Nugent</div>
<div>Created 20 Jan 2009</div>
<div>by Tom Igoe</div>
<div>*/</div>
<div>#include &lt;Servo.h&gt;      // include the servo library</div>
<div>Servo servoMotor;       // creates an instance of the servo object to control a servo</div>
<div>int analogPin = 0;      // the analog pin that the sensor is on</div>
<div>int analogValue = 0;    // the value returned from the analog sensor</div>
<div>int servoPin = 2;       // <em>Control pin for servo motor, may only be pin 9 or 10</em></div>
<div>void setup() {</div>
<div>servoMotor.attach(servoPin);  // attaches the servo on pin 2 to the servo object</div>
<div>}</div>
<div>void loop()</div>
<div>{</div>
<div>analogValue = analogRead(analogPin);                 // read the analog input (value between 0 and 1023)</div>
<div>analogValue = map(analogValue, 0, 1023, 0, 179);     // map the analog value (0 &#8211; 1023) to the angle of the servo (0 &#8211; 179)</div>
<div>servoMotor.write(analogValue);                       // write the new mapped analog value to set the position of the servo</div>
<div>delay(15);                                           // waits for the servo to get there</div>
<div>}</div>
</div>
<div>
<h2>Tone Output with Arduino</h2>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2864.jpg" title="img_2864" rel="lightbox[320]"><img class="alignnone size-medium wp-image-322" title="img_2864" src="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2864-300x225.jpg" alt="img_2864" width="300" height="225" /></a></p>
<p><a href="http://www.pixelpunchout.com/wp-content/uploads/2009/10/img_2864.jpg"></a><strong>Tone Output Lab: </strong>Teaches folks how to output sound effects with the Arduino using the Tone Library, Analog Sensor, and a speaker. The Analog Sensor () would not work for this project, FYI, because hooking a speaker, an analog sensor, and Arduino would only work on the output volume and not the TONE.</p>
<p><strong>Breadboard Layout: </strong>Notice the 2 photo sensors (variable resistors) that share a power outlet between them. The Photo sensors divide the voltage, therefore, there is no need for resistors to stem current flow since the two divvy it up between them (preventing a short circuit). The speaker is hooked up with wires leading from ground, power bus row. A resistor is used to stem voltage before it reaches the AnalogIn wire.</p>
<p>See it all on Video!:<br />
<object width="500" height="375"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6863086&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6863086&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="375"></embed></object>
<p><a href="http://vimeo.com/6863086">Intro to Physical Computing: Servo Motor Control, Tone Output with Arduino</a> from <a href="http://vimeo.com/user758179">cindy wong</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><strong>Tone Output Code (Photo Cells in Setup in Above Photo)</strong></div>
<p>*<br />
Theremin</p>
<p>Plays tones based on a sensor reading uses Tone library by Brett Hagman</p>
<p>http://code.google.com/p/arduino-tone/</p>
<p>circuit:<br />
* photoresistor from +5V to analog in 0<br />
* photoresistor from analog pin 0 to ground<br />
* 8-ohm speaker on digital pin 8</p>
<p>created 10 Sep 2009<br />
by Tom Igoe<br />
*/</p>
<p>#include<br />
Tone noiseMaker;    // instance of the tone library</p>
<p>void setup() {<br />
// start the music:<br />
noiseMaker.begin(8);<br />
}</p>
<p>void loop() {<br />
// get a sensor reading:<br />
int sensorReading = analogRead(0);<br />
// map the results from the sensor reading&#8217;s range<br />
// to the desired pitch range:<br />
int pitch = map(sensorReading, 200, 900, 100, 1000);<br />
// change the pitch:<br />
noiseMaker.play(pitch);<br />
}</p>
<p><strong>Tone Setup with 3 Variable Resistors (Pentiometers, below)</strong></p>
<p><strong><br />
</strong></p>
<p>/*</p>
<p>circuit:</p>
<p>* 3 force-sensing resistors from +5V to analog in 0 through 5</p>
<p>* 3 10K resistors from analog in 0 through 5 to ground</p>
<p>* 8-ohm speaker on digital pin 8</p>
<p>*/</p>
<p>#include &lt;Tone.h&gt;</p>
<p>Tone noiseMaker;    // instance of the tone library</p>
<p>const int threshold = 10;    // minimum reading of the sensors that generates a note</p>
<p>// notes to play, corresponding to the 3 sensors:</p>
<p>int notes[] = {</p>
<p>NOTE_A4, NOTE_B4,NOTE_C4 };</p>
<p>void setup() {</p>
<p>// start the music:</p>
<p>noiseMaker.begin(8);</p>
<p>}</p>
<p>void loop() {</p>
<p>for (int thisSensor = 0; thisSensor &lt; 3; thisSensor++) {</p>
<p>// get a sensor reading:</p>
<p>int sensorReading = analogRead(thisSensor);</p>
<p>// if the sensor is pressed hard enough:</p>
<p>if (sensorReading &gt; threshold) {</p>
<p>// play the note corresponding to this sensor:</p>
<p>noiseMaker.play(notes[thisSensor]);</p>
<p>}</p>
<p>else {</p>
<p>// stop playing:</p>
<p>noiseMaker.stop();</p>
<p>}</p>
<p>}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://pixelpunchout.com/2009/10/pcomp-week-4-servo-motor-control-tone-output-with-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
