<?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>yihanz@andrew.cmu.edu &#8211; Making Things Interactive</title>
	<atom:link href="https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;author=21" rel="self" type="application/rss+xml" />
	<link>https://courses.ideate.cmu.edu/48-339/s2018</link>
	<description>48-339/739 Spring 2018</description>
	<lastBuildDate>Tue, 10 Apr 2018 18:09:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.20</generator>
	<item>
		<title>Lending Desk hours during Carnival</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=672</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=672#respond</comments>
				<pubDate>Tue, 10 Apr 2018 18:09:06 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=672</guid>
				<description><![CDATA[Lending schedule next week will be: Thu(4/19): close by 6pm Fri(4/20): open 8am &#8211; 1pm, close by 1pm Sat(4/21): close all day Sun(4/22): open 10am &#8211; 10pm ( back to regular hours)]]></description>
								<content:encoded><![CDATA[<p>Lending schedule next week will be:</p>
<p>Thu(4/19): close by 6pm</p>
<p>Fri(4/20): open 8am &#8211; 1pm, close by 1pm</p>
<p>Sat(4/21): close all day</p>
<p>Sun(4/22): open 10am &#8211; 10pm ( back to regular hours)</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=672</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>An interactive music box</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=649</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=649#respond</comments>
				<pubDate>Tue, 10 Apr 2018 15:38:45 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Final Proposals]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=649</guid>
				<description><![CDATA[An wireless music player with physical interaction to minimize distraction. DESCRIPTIVE PARAGRAPH Why a music box? I like to put music on while i&#8217;m working, however in this digital age, the &#8220;recommendations&#8221; and changing between screens can be quite a distraction. A music box with physical interaction should be able to minize that as much &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=649" class="more-link">Continue reading<span class="screen-reader-text"> "An interactive music box"</span></a>]]></description>
								<content:encoded><![CDATA[<h3>An wireless music player with physical interaction to minimize distraction.</h3>
<h4>DESCRIPTIVE PARAGRAPH</h4>
<p>Why a music box?</p>
<p style="padding-left: 30px">I like to put music on while i&#8217;m working, however in this digital age, the &#8220;recommendations&#8221; and changing between screens can be quite a distraction. A music box with physical interaction should be able to minize that as much as possible, while still kept the interaction entertaining.</p>
<p>How it works:</p>
<p style="padding-left: 30px">The music box would come with figurines with RFID tags. When different figurines are put on top of the music box,  different sets of music would play. Ideally, if it can be achieved, the user can put their own music album and make their own figurine.</p>
<p>&nbsp;</p>
<h4>YOUR PLAN</h4>
<p>The final project would be based on the previous assignment where I used touch sensor and Arduino Uno with a simple p5js interface. Here is the basic outline of the project:</p>
<ol>
<li>Incorporate/test RFID onto the project</li>
<li>Connect speaker to the box instead of using laptop</li>
<li>Refine the music library</li>
<li>Refine the p5js interface</li>
<li>Add the feature where user are able to make their own input</li>
<li>Switch Arduino Uno to a Particle Photon</li>
<li></li>
<li>Add lipo battery and battery shield/battery baby sitter</li>
<li>Make a shell with laser cutted plywood</li>
</ol>
<h4>MATERIALS NEEDED</h4>
<ol>
<li>Arduino Uno/Particle Photon</li>
<li>RFID Reader chip and RFID tags</li>
<li>Wifi base (I might be able to just use my laptop)</li>
<li>Plywood for laser cutted bounding box</li>
<li>Music Pieces (20s-30s per sample)</li>
<li>Lipo battery</li>
<li>Battery shield/baby sitter</li>
<li>Some LEDs for indication</li>
<li>Some buttons for play buttons etc.</li>
<li>A cheap speaker should workout</li>
</ol>
<h4>DELIVERABLES FOR SHOW</h4>
<p>On the day of the show, I would need a outlet for charging the battery, and a wifi base, which potentially could be my laptop. The speaker won&#8217;t be too loud so it should be ok to be somewhat close to other projects.</p>
<h4>MEDIA FOR SHOW</h4>
<p>I probably would put up a slide show on my laptop or some print out handouts/flyers</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=649</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Story &#8211; Music Box</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=611</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=611#respond</comments>
				<pubDate>Thu, 05 Apr 2018 17:00:12 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=611</guid>
				<description><![CDATA[I listen to a lot of musicals, and that is my background music when I work. Listen to the same thing over and over again is nice to some extent, however, stories might be told differently from different character&#8217;s perspective. What if the version of the story is from Elisa Schulyer instead of Alexander Hamilton? &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=611" class="more-link">Continue reading<span class="screen-reader-text"> "Story &#8211; Music Box"</span></a>]]></description>
								<content:encoded><![CDATA[<p>I listen to a lot of musicals, and that is my background music when I work. Listen to the same thing over and over again is nice to some extent, however, stories might be told differently from different character&#8217;s perspective. What if the version of the story is from Elisa Schulyer instead of Alexander Hamilton? What if Cosette is the major character? Not that the music need to change (for a new show, probably).</p>
<p>It would be really interesting to make a interactive music box that have the same song but tells the same story from a different sequence based on the main character that you can choose. It should be mobile, with a rechargable battery, like a real music box (it would be a interesting gift). It doesn&#8217;t have to be just musical, it can get connected to wifi and search for certain artist that you wanna listen to. All you need to do is to put a figurine on top and click the play button.</p>
<p>What would be the advantage of having a music box than just use your phone or your computer? Well, say that you are using some music software like spotify. When you want to change a song, you have to go to that interface and click the music you want to listen to. Opening up another page could be really distracting, spotify might also recommend you this and that which doesn&#8217;t help. Having a physical interaction can potentially make you less distracted cause there is no “recommend based on history&#8221; at least.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=611</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Final project storyboarding &#8211; storytelling musicbox</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=575</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=575#respond</comments>
				<pubDate>Tue, 03 Apr 2018 15:40:34 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=575</guid>
				<description><![CDATA[The general idea of interaction goes like this: place some figurine on top of the box, assume the sequence being figurine1 (f1 for short),f2,f3&#8230;&#8230; Hit play button to play music (where all figurine is a part of, from the very first story) remove some figurine and add more figurine or do nothing to play more &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=575" class="more-link">Continue reading<span class="screen-reader-text"> "Final project storyboarding &#8211; storytelling musicbox"</span></a>]]></description>
								<content:encoded><![CDATA[<p>The general idea of interaction goes like this:</p>
<ol>
<li>place some figurine on top of the box, assume the sequence being figurine1 (f1 for short),f2,f3&#8230;&#8230;</li>
<li>Hit play button to play music (where all figurine is a part of, from the very first story)</li>
<li>remove some figurine and add more figurine or do nothing to play more music:
<ol>
<li>if nothing change, go to the next song that all of them are in follow the story sequence</li>
<li>if new figurine added, play the next song they all in</li>
<li>if figurine got removed: (assume f1, f2,f3 was there)
<ol>
<li>if f2 or f3 got removed, same as new figurine added</li>
<li>if f1 got removed, f2 becomes the pivot*.</li>
</ol>
</li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<ul>
<li>*Pivot in this case is that favour the pivot figurine, if no songs are really up to standards(eg: strictly solo/duet).</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=575</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Super cool liquid/not liquid experiment</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=394</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=394#respond</comments>
				<pubDate>Tue, 20 Feb 2018 01:31:19 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Looking Outside]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=394</guid>
				<description><![CDATA[]]></description>
								<content:encoded><![CDATA[<p><iframe width="840" height="473" src="https://www.youtube.com/embed/My4RA5I0FKs?feature=oembed" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=394</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Virtural &#8220;Etch a Sketch&#8221;</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=263</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=263#respond</comments>
				<pubDate>Tue, 06 Feb 2018 09:20:23 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 3]]></category>
		<category><![CDATA[Assignments]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=263</guid>
				<description><![CDATA[For this assignment, I used two potentiometers to simulate the &#8220;Etch A Sketch&#8221; (Wikipedia_&#8221;Etch A Sketch&#8221;). Using two potentiometer, one controls left and right movement, and the other controls the up and down movement, the browser window is going to serve as a canvas for the &#8220;Etch A Sketch&#8221; board. &#160; Parts list: Potentiometer (10K)  &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=263" class="more-link">Continue reading<span class="screen-reader-text"> "Virtural &#8220;Etch a Sketch&#8221;"</span></a>]]></description>
								<content:encoded><![CDATA[<p>For this assignment, I used two potentiometers to simulate the &#8220;Etch A Sketch&#8221; (<a href="https://en.wikipedia.org/wiki/Etch_A_Sketch">Wikipedia_&#8221;Etch A Sketch&#8221;</a>). Using two potentiometer, one controls left and right movement, and the other controls the up and down movement, the browser window is going to serve as a canvas for the &#8220;Etch A Sketch&#8221; board.</p>
<p>&nbsp;</p>
<ul>
<li>Parts list:
<ul>
<li>Potentiometer (10K)  x2</li>
<li>Adafruit M0 Metro Express</li>
<li>Bunch of jumper wires</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Fritzing Sketch:</p>
<p><img class="alignnone wp-image-277" src="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch_bb-300x123.jpg" alt="" width="468" height="192" srcset="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch_bb-300x123.jpg 300w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch_bb-768x316.jpg 768w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch_bb-1024x421.jpg 1024w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch_bb-1200x493.jpg 1200w" sizes="(max-width: 468px) 85vw, 468px" /></p>
<p>&nbsp;</p>
<p>Code (Arduino Part):</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #993333;">const</span> <span style="color: #993333;">int</span> leftRightPot <span style="color: #339933;">=</span> A4<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//with green LED</span><br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> upDownPot <span style="color: #339933;">=</span> A5<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// with blue LED</span><br />
<br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> tol <span style="color: #339933;">=</span> <span style="color: #0000dd;">100</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">int</span> leftRightVal <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">int</span> upDownVal <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">int</span> valHi <span style="color: #339933;">=</span> <span style="color: #0000dd;">1024</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">int</span> valLo <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">//******************************</span><br />
<span style="color: #666666; font-style: italic;">//Setup for Arduino to run</span><br />
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// put your setup code here, to run once:</span><br />
&nbsp;pinMode<span style="color: #009900;">&#40;</span>leftRightPot <span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;pinMode<span style="color: #009900;">&#40;</span>upDownPot<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">//******************************</span><br />
<span style="color: #666666; font-style: italic;">//The operating loop</span><br />
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// put your main code here, to run repeatedly:</span><br />
&nbsp;leftRightVal <span style="color: #339933;">=</span> reMapped<span style="color: #009900;">&#40;</span>analogRead<span style="color: #009900;">&#40;</span>leftRightPot<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;upDownVal <span style="color: #339933;">=</span> reMapped<span style="color: #009900;">&#40;</span>analogRead<span style="color: #009900;">&#40;</span>upDownPot<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Serial.print(&quot;leftRightVal = &quot;);</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// Serial.println(leftRightVal);</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Modified from class Note 5</span><br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;leftRightVal,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>leftRightVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;,upDownVal,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>upDownVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">//***********************************</span><br />
<span style="color: #666666; font-style: italic;">//function used to remap input value into one</span><br />
<span style="color: #993333;">int</span> reMapped<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> input<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #993333;">int</span> output <span style="color: #339933;">=</span> map<span style="color: #009900;">&#40;</span>input<span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1023</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #b1b100;">return</span> output<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>&nbsp;</p>
<p>Code (js part):</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000066; font-weight: bold;">var</span> cnv<span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> serial<span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> portName <span style="color: #339933;">=</span> <span style="color: #3366CC;">'COM4'</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> dataRead<span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">//@TODO : find out what port name it is</span><br />
<br />
<span style="color: #006600; font-style: italic;">//***************</span><br />
<span style="color: #006600; font-style: italic;">//Here are some global variables:</span><br />
<span style="color: #006600; font-style: italic;">//@TODO: Figure out how to make them function in OOP</span><br />
<span style="color: #000066; font-weight: bold;">var</span> curPosX <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> curPosY <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> leftRightVal <span style="color: #339933;">=</span> <span style="color: #CC0000;">255</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> upDownVal <span style="color: #339933;">=</span> <span style="color: #CC0000;">255</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">const</span> rightUpThresh <span style="color: #339933;">=</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">const</span> leftDownThresh <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">var</span> xPoint<span style="color: #339933;">=</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">var</span> yPoint<span style="color: #339933;">=</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// ****************</span><br />
<span style="color: #006600; font-style: italic;">//Basic setup for serial port and canvas</span><br />
<span style="color: #006600; font-style: italic;">//******************</span><br />
<span style="color: #000066; font-weight: bold;">function</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<br />
&nbsp;serial <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> p5.<span style="color: #660066;">SerialPort</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// now set a number of callback functions for SerialPort</span><br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'list'</span><span style="color: #339933;">,</span> printList<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'connected'</span><span style="color: #339933;">,</span> serverConnected<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</span><span style="color: #339933;">,</span> portOpen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data'</span><span style="color: #339933;">,</span> serialEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #339933;">,</span> serialError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;serial.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'close'</span><span style="color: #339933;">,</span> portClose<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
serial.<span style="color: #660066;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;serial.<span style="color: #660066;">open</span><span style="color: #009900;">&#40;</span>portName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//Here is canvas setup</span><br />
&nbsp;createCanvas<span style="color: #009900;">&#40;</span>windowWidth<span style="color: #339933;">,</span> windowHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>windowWidth <span style="color: #339933;">-</span> width<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>windowHeight <span style="color: #339933;">-</span> height<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">;</span><br />
&nbsp;cnv.<span style="color: #660066;">position</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<br />
&nbsp;background <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;white&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
<br />
<br />
<span style="color: #006600; font-style: italic;">//**********************</span><br />
<span style="color: #006600; font-style: italic;">//Put drawing functions in here</span><br />
<span style="color: #000066; font-weight: bold;">function</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// put drawing code here </span><br />
&nbsp;mouseSetPt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;drawWithPot<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;drawPts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #006600; font-style: italic;">//**************************</span><br />
<span style="color: #006600; font-style: italic;">//click mouse and reset the drawing point</span><br />
<span style="color: #000066; font-weight: bold;">function</span> mouseSetPt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">//get the point where the mouse clicks</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> mouseClickX <span style="color: #339933;">=</span> mouseX<span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> mouseClickY <span style="color: #339933;">=</span> mouseY<span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//update the point in the array</span><br />
&nbsp;xPoint <span style="color: #339933;">=</span> xPoint <span style="color: #339933;">+</span> <span style="color: #009900;">&#91;</span>mouseClickX<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;yPoint <span style="color: #339933;">=</span> yPoint <span style="color: #339933;">+</span> <span style="color: #009900;">&#91;</span>mouseClickY<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//update the current/new position to start</span><br />
&nbsp;curPosX <span style="color: #339933;">=</span> xPoint<span style="color: #009900;">&#91;</span>xPoint.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;curPosY <span style="color: #339933;">=</span> yPoint<span style="color: #009900;">&#91;</span>yPoint.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #006600; font-style: italic;">//****************************</span><br />
<span style="color: #006600; font-style: italic;">//use potentiometer to draw (only moving left/right and up/down)</span><br />
<span style="color: #000066; font-weight: bold;">function</span> drawWithPot<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">//@TODO: find a better way to store tese values, like tuples?</span><br />
<br />
<span style="color: #006600; font-style: italic;">//check right and left</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>leftRightVal <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> rightUpThresh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;curPosX <span style="color: #339933;">=</span> curPosX <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>leftRightVal <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> leftDownThresh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;curPosX <span style="color: #339933;">=</span> curPosX <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//check up and down</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>upDownVal <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> rightUpThresh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;curPosY <span style="color: #339933;">=</span> curPosY <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>upDownVal <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> leftDownThresh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;curPosY <span style="color: #339933;">=</span> curPosY <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//update the position list</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> prePosX <span style="color: #339933;">=</span> xPoint<span style="color: #009900;">&#91;</span>xPoint.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> prePosY <span style="color: #339933;">=</span> yPoint<span style="color: #009900;">&#91;</span>yPoint.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>curPosX <span style="color: #339933;">!=</span> prePosX <span style="color: #339933;">||</span> curPosY <span style="color: #339933;">!=</span> prePosY<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;xPoint <span style="color: #339933;">=</span> xPoint <span style="color: #339933;">+</span> <span style="color: #009900;">&#91;</span>curPosX<span style="color: #009900;">&#93;</span><br />
&nbsp;yPoint <span style="color: #339933;">=</span> yPoint <span style="color: #339933;">+</span> <span style="color: #009900;">&#91;</span>curPosY<span style="color: #009900;">&#93;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//************************</span><br />
<span style="color: #006600; font-style: italic;">//Draw all the points that is saved in the array</span><br />
<span style="color: #000066; font-weight: bold;">function</span> drawPts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> xPoint.<span style="color: #660066;">length</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> xPointPos <span style="color: #339933;">=</span> xPoint<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> yPointPos <span style="color: #339933;">=</span> yPoint<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;point<span style="color: #009900;">&#40;</span>xPointPos<span style="color: #339933;">,</span> yPointPos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//*****************************</span><br />
<span style="color: #006600; font-style: italic;">//All server related</span><br />
<span style="color: #000066; font-weight: bold;">function</span> printList<span style="color: #009900;">&#40;</span>portList<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// for (var i = 0; i &amp;lt; portList.length; i++) {</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// print(i + &quot; &quot; + portList[i]);</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// }</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">function</span> serverConnected<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp;print<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'serverConnected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">function</span> portOpen<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp;print<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'portOpen'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">function</span> serialEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">var</span> strRead <span style="color: #339933;">=</span> serial.<span style="color: #660066;">readStringUnil</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>strRead.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">var</span> potStr <span style="color: #339933;">=</span> split<span style="color: #009900;">&#40;</span>strRead<span style="color: #339933;">,</span> <span style="color: #3366CC;">','</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>potStr.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// ignore any tiny strings</span><br />
&nbsp;leftRightVal <span style="color: #339933;">=</span> potStr<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;upDownVal <span style="color: #339933;">=</span> potStr<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #000066; font-weight: bold;">function</span> serialError<span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp;print<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'serialError '</span> <span style="color: #339933;">+</span> err<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">function</span> portClose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp;print<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'portClose'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>&nbsp;</p>
<p><a href="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Etch-A-Sketch.zip">Zip -Etch A Sketch</a></p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=263</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Walking in the Dark</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=232</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=232#respond</comments>
				<pubDate>Thu, 01 Feb 2018 17:08:15 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=232</guid>
				<description><![CDATA[Background: For people who have migrane, it is terribly painful to turn on the light in the room (any light is unbearable at times) or have sound playing, talking would be painful. Even though this doesn&#8217;t mean they can&#8217;t open their eyes to see things. However, the light and sound sesitivity make it really difficult &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=232" class="more-link">Continue reading<span class="screen-reader-text"> "Walking in the Dark"</span></a>]]></description>
								<content:encoded><![CDATA[<p>Background: For people who have migrane, it is terribly painful to turn on the light in the room (any light is unbearable at times) or have sound playing, talking would be painful. Even though this doesn&#8217;t mean they can&#8217;t open their eyes to see things. However, the light and sound sesitivity make it really difficult for them to walk around in the house for certain necesaties.</p>
<p>Therefore, my project is to help people when they have to walk in the dark, and lights cannot be used as an indicator. Instead of lights, I used buzzer as indicator. If the person is too close to the wall on the left, the buzzer on the left (stick on the person&#8217;s hand) will vibrate. Same goes to the buzzer on the right. However, if they have a pet at home, the pir sensor attached to their chest will be active and the buzzer will both buzz at a certain meter.</p>
<p>[Insert picture here]</p>
<p>&nbsp;</p>
<p>Here is the code part of it:</p>
<pre>

<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #808080; font-style: italic;">/* Jean Zhang<br />
<br />
<br />
*/</span><br />
<br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> leftDistPin <span style="color: #339933;">=</span> A1<span style="color: #339933;">;</span><br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> rightDistPin <span style="color: #339933;">=</span> A2<span style="color: #339933;">;</span><br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> pirPin <span style="color: #339933;">=</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> buzzLeft <span style="color: #339933;">=</span> <span style="color: #0000dd;">6</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> buzzRight <span style="color: #339933;">=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> critDist <span style="color: #339933;">=</span> <span style="color: #0000dd;">950</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// somewhat arbitrary number</span><br />
<br />
<span style="color: #993333;">int</span> leftDist <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">int</span> rightDist <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">int</span> buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">int</span> buzzStatePrev <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<br />
<br />
bool isPet <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<br />
<br />
<span style="color: #993333;">void</span> petPresent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>pirPin <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;isPet <span style="color: #339933;">=</span> <span style="color: #339933;">!</span>isPet<span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>isPet<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #993333;">void</span> determineState<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>leftDist <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> critDist<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>rightDist <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> critDist<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>rightDist <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> critDist<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>isPet <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;buzzState <span style="color: #339933;">=</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// put your setup code here, to run once:</span><br />
<br />
Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
pinMode<span style="color: #009900;">&#40;</span>leftDistPin<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;pinMode<span style="color: #009900;">&#40;</span>rightDistPin<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;pinMode<span style="color: #009900;">&#40;</span>pirPin<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
pinMode<span style="color: #009900;">&#40;</span>buzzLeft<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;pinMode<span style="color: #009900;">&#40;</span>buzzRight<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<br />
&nbsp;<span style="color: #666666; font-style: italic;">//attach Interrupt</span><br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>isPet <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;attachInterrupt<span style="color: #009900;">&#40;</span> digitalPinToInterrupt <span style="color: #009900;">&#40;</span>pirPin<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> petPresent<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// put your main code here, to run repeatedly:</span><br />
<br />
<span style="color: #666666; font-style: italic;">//read distance and compare to critDist</span><br />
&nbsp;leftDist <span style="color: #339933;">=</span> analogRead<span style="color: #009900;">&#40;</span>leftDistPin<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;rightDist <span style="color: #339933;">=</span> analogRead<span style="color: #009900;">&#40;</span>rightDistPin<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
buzzStatePrev <span style="color: #339933;">=</span> buzzState<span style="color: #339933;">;</span><br />
&nbsp;determineState<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>leftDist<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot; right&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>rightDist<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp;Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;buzzState&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>buzzState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>buzzStatePrev <span style="color: #339933;">!=</span> buzzState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>buzzState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">:</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzRight<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">:</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzLeft<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">:</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzRight<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzLeft<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">:</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzRight<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzLeft<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;delay <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//@TODO: write a function that does not use delay</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzRight<span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;digitalWrite<span style="color: #009900;">&#40;</span>buzzLeft<span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;delay <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Yeah, try not to use delay</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
<br />
<br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #009900;">&#125;</span></div></div>

</pre>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=232</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Assignment 1 &#8211; Distance gamer</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=149</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=149#respond</comments>
				<pubDate>Tue, 23 Jan 2018 11:44:21 +0000</pubDate>
		<dc:creator><![CDATA[yihanz@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 1]]></category>
		<category><![CDATA[Assignments]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=149</guid>
				<description><![CDATA[This is ment to be a toy for cats and dogs, where the closer they are to the toy, the brighter the LED is going to be. And when they put their paws on th button (it&#8217;s a photoresistor), the LED with stop for however long they leave their paws in place. &#160; Material: 1x  &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=149" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 1 &#8211; Distance gamer"</span></a>]]></description>
								<content:encoded><![CDATA[<p>This is ment to be a toy for cats and dogs, where the closer they are to the toy, the brighter the LED is going to be. And when they put their paws on th button (it&#8217;s a photoresistor), the LED with stop for however long they leave their paws in place.</p>
<p>&nbsp;</p>
<p>Material:</p>
<ul>
<li>1x  IR distance sensor</li>
<li>1x  photoresistor</li>
<li>1x  3.3v LED</li>
<li>1x  10k potentiometer</li>
<li>1x  220 resistor</li>
<li>Adafruit Metro M0 Express</li>
</ul>
<p>Setup:</p>
<figure id="attachment_156" aria-describedby="caption-attachment-156" style="width: 4048px" class="wp-caption aligncenter"><img class="wp-image-156 size-full" src="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616.jpg" alt="" width="4048" height="3036" srcset="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616.jpg 4048w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616-300x225.jpg 300w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616-768x576.jpg 768w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616-1024x768.jpg 1024w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/01/IMG_20180123_064616-1200x900.jpg 1200w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /><figcaption id="caption-attachment-156" class="wp-caption-text">Initially prototyped with 2 photoresistor instead of ir sensor to test the data (which haven&#8217;t really happen yet)</figcaption></figure>
<p>Code:</p>
<pre>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">/*<br />
&nbsp; Jean Zhang<br />
<br />
<br />
&nbsp; This is a sketch about a toy for pets (hopefully).<br />
&nbsp; This is Ver 1.0 which is a easy prototype, a proof of<br />
&nbsp; concept that the code/board/sensors works properly.<br />
<br />
&nbsp; This code is modified from the class 2 note from<br />
&nbsp; Prof. J. Eric Townsend.The lisence is as the following:<br />
<br />
<br />
<br />
&nbsp; The MIT License (MIT)<br />
<br />
&nbsp; Copyright (c) 2014 J. Eric Townsend<br />
<br />
&nbsp; Permission is hereby granted, free of charge, to any person obtaining a copy<br />
&nbsp; of this software and associated documentation files (the &quot;Software&quot;), to deal<br />
&nbsp; in the Software without restriction, including without limitation the rights<br />
&nbsp; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br />
&nbsp; copies of the Software, and to permit persons to whom the Software is<br />
&nbsp; furnished to do so, subject to the following conditions:<br />
<br />
&nbsp; The above copyright notice and this permission notice shall be included in<br />
&nbsp; all copies or substantial portions of the Software.<br />
<br />
&nbsp; THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
&nbsp; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
&nbsp; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />
&nbsp; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
&nbsp; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />
&nbsp; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br />
&nbsp; THE SOFTWARE.<br />
<br />
&nbsp; This code is modified from the original code by Jean Zhang.<br />
&nbsp; Lots of thanks to Robert Zacharias and Professor Garth Zeglin for helping out with debugging and making the code to properly compile.<br />
<br />
<br />
<br />
<br />
*/<br />
const int irPin = 0;<br />
const int photoPin = 1;<br />
const int ledPin = 8;<br />
<br />
const int sampleSize = 16;<br />
<br />
int irIndex = 0;<br />
int irReadings[sampleSize];<br />
<br />
int photoIndex = 0;<br />
int photoReadings[sampleSize];<br />
<br />
int distVal, photoVal, ledVal;<br />
<br />
const int ambientPhoto = 600;<br />
const int tolerance = 200;<br />
<br />
<br />
<br />
void setup() {<br />
&nbsp; Serial.begin(115200);<br />
<br />
&nbsp; pinMode(irPin, INPUT);<br />
&nbsp; pinMode(photoPin, INPUT);<br />
&nbsp; pinMode(ledPin, OUTPUT);<br />
<br />
<br />
&nbsp; // put your setup code here, to run once:<br />
<br />
}<br />
<br />
void loop() {<br />
&nbsp; //Reading the values from ir and photoResistor<br />
&nbsp; int photo = analogRead(photoPin);<br />
&nbsp; photoReadings[photoIndex] = photo;<br />
&nbsp; photoIndex = (photoIndex + 1) % sampleSize;<br />
<br />
&nbsp; int irDist = analogRead(irPin);<br />
&nbsp; irReadings[irIndex] = irDist;<br />
&nbsp; irIndex = (irIndex + 1) % sampleSize;<br />
<br />
&nbsp; //Get readings for irSensors<br />
&nbsp; int *pirReadings = irReadings;<br />
&nbsp; distVal = getVal(pirReadings); // feed the pointer of the array (array location)<br />
// &nbsp;photoVal = getVal(*photoReadings);<br />
<br />
<br />
<br />
&nbsp; // console<br />
#if 0<br />
&nbsp; Serial.print(&quot;low &quot;);<br />
&nbsp; Serial.print(low);<br />
&nbsp; Serial.print(&quot; high &quot;);<br />
&nbsp; Serial.print(high);<br />
&nbsp; Serial.print(&quot; mean &quot;);<br />
&nbsp; Serial.println(mean);<br />
&nbsp; Serial.print(&quot; median &quot;);<br />
&nbsp; Serial.println(median);<br />
&nbsp; delay(500);<br />
&nbsp; digitalWrite(photoPin, LOW);<br />
&nbsp; delay(500);<br />
#endif<br />
<br />
<br />
&nbsp; int ledVal = map(distVal, 0, 1023, 0, 255);<br />
&nbsp; //0 (min) is based on the ambient setting<br />
<br />
&nbsp; if (abs(ambientPhoto - photoVal) &amp;gt; tolerance) {<br />
&nbsp; &nbsp; ledVal = 0;<br />
&nbsp; }<br />
<br />
&nbsp; analogWrite(ledPin, ledVal);<br />
<br />
<br />
<br />
}<br />
<br />
//Modified from class note:<br />
int getVal(int *readings) { //return mean for now<br />
&nbsp; int median = 0;<br />
&nbsp; int low = 1024;<br />
&nbsp; int high = 0;<br />
&nbsp; int mean = 0;<br />
&nbsp; for (int i = 0; i &amp;lt; sampleSize; i++) {<br />
&nbsp; &nbsp; mean += readings[i];<br />
&nbsp; &nbsp; if (readings[i] &amp;lt; low) { low = readings[i]; } if (readings[i] &amp;gt; high) {<br />
&nbsp; &nbsp; &nbsp; high = readings[i];<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
&nbsp; mean = mean / sampleSize;<br />
&nbsp; bubbleSort(readings);<br />
&nbsp; median = readings[sampleSize / 2];<br />
<br />
&nbsp; return mean;<br />
&nbsp; //return median<br />
}<br />
//In C, a function cannot return an array<br />
<br />
<br />
<br />
<br />
// tigoe's sort for an array<br />
// since bubbleSort changes the array locally, the function doesn't<br />
// need to return any value<br />
void bubbleSort(int *readings) {<br />
&nbsp; int out, in, swapper;<br />
&nbsp; for (out = 0 ; out &amp;lt; sampleSize; out++) { // outer loop<br />
&nbsp; &nbsp; for (in = out; in &amp;lt; (sampleSize - 1); in++) { // inner loop if ( readings[in] &amp;gt; readings[in + 1] ) { // out of order?<br />
&nbsp; &nbsp; &nbsp; &nbsp; // swap them:<br />
&nbsp; &nbsp; &nbsp; &nbsp; swapper = readings[in];<br />
&nbsp; &nbsp; &nbsp; &nbsp; readings [in] = readings[in + 1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; readings [(in + 1)] = swapper;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
<br />
}</div></div>

</pre>
<p>&nbsp;</p>
<p>Reflection:</p>
<p>I haven&#8217;t been able to get my hardware to work at the moment (just started testing like 10min ago). I spent a lot of time trying to debug the program. I had lots of issue with C++ since I didn&#8217;t really learn how to program in C besides reading codes for reference in my Python Projects (so much less work&#8230;).</p>
<p>My biggest issue is with the syntax of functions and the &#8220;pointer&#8221;  in C. I wanted to make the return median/mean part into a function and use bubbleSort multiple times on different sensor values, where instead of changing the global, it takes in an array and sort that array. The problem being when defining function,  it is defining certain type of data/value. And the take-in value need to be defined for their data type . However, when the take in value is an array, the pointer concept comes into play, and I keep getting the error like this</p>
<pre>invalid types 'int[int]' for array subscript</pre>
<p>After lots of Google-ing and reading comments I start to understand the concept of pointers and modify my code accordingly. (It is actually a really simple solution, kinda like the x.^x &#8211; the dot syntax in MATLAB). Instead of using :</p>
<pre><span style="font-family: Inconsolata, monospace">void bubbleSort(int readings) { ........</span></pre>
<p>Simply change the expression into:</p>
<pre><span style="font-family: Inconsolata, monospace">void bubbleSort(int *readings) { ........ </span></pre>
<p>Note the different between &#8220;<span style="font-family: Inconsolata, monospace">int readings</span>&#8221; and &#8220;<span style="font-family: Inconsolata, monospace">int *readings</span>&#8220;.  Where *readings is a pointer and readings is not really a valid input.</p>
<p>I also tried to return an array for bubbleSort, which I don&#8217;t have to do that (bad habit writing python programs, it does so much for you).  In C, a function cannot return an array, instead, the way to return arraies is to use pointers, which also gave me a lot of problems when compiling.</p>
<p>&nbsp;</p>
<p>Lots of thanks to Robert Zacharias and Professor Garth Zeglin for helping with the bug in the code (mainly for the pointer spaghetti) and making the code compile properly.</p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=149</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
