<?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>David Phillips &#187; clock</title>
	<atom:link href="http://davidphillips.us/tag/clock/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidphillips.us</link>
	<description>Hiya!  I&#039;m a recent ITP graduate student living in New York.  I am hybrid of both designer and front end developer.  I make a mean Keynote too.</description>
	<lastBuildDate>Thu, 19 Jan 2012 18:44:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Stupid Pet Trick: The Zombie Alarm Clock</title>
		<link>http://davidphillips.us/2009/10/stupid-pet-trick-the-zombie-alarm-clock/</link>
		<comments>http://davidphillips.us/2009/10/stupid-pet-trick-the-zombie-alarm-clock/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 02:42:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[pet]]></category>
		<category><![CDATA[physical computing]]></category>
		<category><![CDATA[stupid]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[zombie]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=94</guid>
		<description><![CDATA[www.youtube.com/watch?v=NsZ_cIv32Mg The events took many, many days to get it to work.  However, the end result was exactly what I wanted. Part Zero &#8211; Starting and then Starting Over The entire goal was for this to be an alarm clock, &#8230; <a href="http://davidphillips.us/2009/10/stupid-pet-trick-the-zombie-alarm-clock/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=NsZ_cIv32Mg&#038;fmt=18">www.youtube.com/watch?v=NsZ_cIv32Mg</a></p>
<p>The events took many, many days to get it to work.  However, the end result was exactly what I wanted.</p>
<p><strong>Part Zero &#8211; Starting and then Starting Over</strong></p>
<p>The entire goal was for this to be an alarm clock, so my assumption was that I needed to find Alarm Clock code for the Arduino.  I found code online and then tried to descipher it.  I understood the basic infrastructure, but the code was so far beyond me as far as transforming it, I decided to scrap it and start with a shorter milestones.</p>
<p><strong>Part One &#8211; Getting the Servo Motor &amp; LED to work with a switch.</strong></p>
<p><strong> </strong></p>
<div id="attachment_108" class="wp-caption alignnone" style="width: 560px"><img class="size-full wp-image-108" title="stupid-pet-trick-1" src="http://davidphillips.us/wp-content/uploads/2009/10/stupid-pet-trick-1.jpg" alt="Putting It Together" width="550" height="413" /><p class="wp-caption-text">Putting It Together</p></div>
<p>My initial work was going through the labs from our homework and trying to fit them to my needs.  The first lab had an LED that reacted to a switch.  I needed the Servo to react to the same switch, but reacted with an analog sensor.  First, I tried them both with the flex sensor, then after some finnagling, I got them to react to the same switch.</p>
<p><strong>Part Two &#8211; Using a clock</strong></p>
<p><strong><img class="alignnone size-full wp-image-109" title="stupid-pet-trick-2" src="http://davidphillips.us/wp-content/uploads/2009/10/stupid-pet-trick-2.jpg" alt="stupid-pet-trick-2" width="550" height="413" /></strong></p>
<p>The next hurdle was to get the Servo to move on a timer.  After several failed attempts of using online code, John The Badass Resident showed me how to use the a <em>startTime=millis();</em> in my void loop, the built-in timer on the Arduino, when you start your code up.  It worked like a charm.  I knew there would be a hurdle when creating the snooze button, but I figured there was a way to work around that.</p>
<p><strong>Part Three &#8211; Abandoning The Clock</strong></p>
<p>Well, after trying to get the timer to work with my Servo and LED, I couldn&#8217;t get it to restart and John was long gone, so I worked with a friend&#8217;s code, Zeven and used a time variable.  That gave me the ability to restart.  For whatever reason, the LED wasn&#8217;t lighting up as well, which made no sense at all.</p>
<p><strong>Part Four &#8211; The Final Arduino Code</strong></p>
<p><strong><img class="alignnone size-full wp-image-110" title="stupid-pet-trick-3" src="http://davidphillips.us/wp-content/uploads/2009/10/stupid-pet-trick-3.jpg" alt="stupid-pet-trick-3" width="550" height="401" /></strong></p>
<p>It&#8217;s the night before and I&#8217;m trying not to stress out.  I again ask for help, apparently getting people into trouble and all sorts of various fun.  I know it&#8217;s a coding issue, and I just don&#8217;t know enough about coding.  John The Awesome Resident puts me in contact with a certain 2nd Year, who will go by the codename &#8220;The Bicyclist.&#8221;  The Bicyclist sits down and wipes out all my void loop code.  We go through and add <strong>two more variables</strong> (timer and stepDelay) and clean up my void setup and, step by step, we go through and piece by piece, make sure the code is speaking to each piece of hardware and then place it on the timer, and then go through and clean it up again.  The trick was really to reset the <em>millis</em> to the current time by nesting it in the <em>long timer</em>.  He showed me firsthand what it was like to code correctly.  It was genius.  Honestly, it&#8217;s to a point where I don&#8217;t want to go code again, cuz I finally did it correctly, and I wanna just have that be my lasting memory.  This is a terrible idea, obviously, so I&#8217;ll be working on the tone library tomorrow.</p>
<p><strong>Part Five &#8211; Aesthetics, Aesthetics, Aesthetics</strong></p>
<p>Until this point in the operation, I didn&#8217;t have any of my visuals put together.  That was the easy part.  I quickly constructed a house front, a fence and put a construction truck on a nice pice of varnished rich wood that I found laying around.  I printed out several zombie pictures, including one from an artist depicting a scene from Pride, Prejudice &amp; Zombies.  I hid the switch behind the piece.</p>
<p><strong>Part 6 &#8211; The Future</strong></p>
<p>The real question is do I continue to pursue this or do I abandon this project?  Is there a market for this?  When the heck would I have time to work on it?  I&#8217;ve given it a bit of thought, and I know what the next phases are:</p>
<ul>
<li><em>Phase 2</em> &#8211; Brighten the LED, add Wave shield to play zombie themed music</li>
<li><em>Phase 3</em> &#8211; Set to clock.</li>
<li><em>Phase 4</em> &#8211; The zombies walking toward the farmhouse would dance to the music when it turns on via servo motors &amp; some clever gearing/pulleys.</li>
<li><em>Phase 5</em> &#8211; Add nightlight funciton. Press button and the Servo goes behind the farmhouse, setting off a transluscent moon graphic with blue LED.  Human in farmhouse turns switches out with one that is werewolf, possibly have zombies turn and look like they&#8217;re running.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/10/stupid-pet-trick-the-zombie-alarm-clock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

