<?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>Liz Arum&#039;s Blog &#187; Blender</title>
	<atom:link href="http://blog.lizarum.com/category/blender/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lizarum.com</link>
	<description>I teach tech and share it</description>
	<lastBuildDate>Tue, 03 Nov 2009 16:42:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Short Week</title>
		<link>http://blog.lizarum.com/2009/10/a-short-week/</link>
		<comments>http://blog.lizarum.com/2009/10/a-short-week/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 13:01:43 +0000</pubDate>
		<dc:creator>Lizabeth Arum</dc:creator>
				<category><![CDATA[Blender]]></category>
		<category><![CDATA[Circuits]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[iPhone Programming]]></category>

		<guid isPermaLink="false">http://blog.lizarum.com/?p=161</guid>
		<description><![CDATA[I finished my soft circuit. Now when you pet it it purrs and flashes its eyes. I added a homemade capacitance sensor and a vibrating motor. I started with this information, but ended up using Paul Badger&#8217;s CapacitiveSense003 library which worked great. My circuit uses a 2.2M&#937; resistor to  connect pins 2 and 5 [...]]]></description>
			<content:encoded><![CDATA[<p>I finished my soft circuit. Now when you pet it it purrs and flashes its eyes. I added a homemade capacitance sensor and a vibrating motor. I started with t<a href="http://www.bytecraft.com/Touch_Sensitive_Switch">his information</a>, but ended up using Paul Badger&#8217;s<a href="http://www.arduino.cc/playground/Main/CapSense"> CapacitiveSense003</a> library which worked great. My circuit uses a 2.2M&Omega; resistor to  connect pins 2 and 5 and the sensor itself is made of conductive frabric from <a href="http://www.lessemf.com/">LessEMF</a>. The piece came from the Fabric Sample Set (Cat. #SAMPLER) and I cut in in half and connected it to pin 2 through conductive thread and a 22 AWG hookup wire. </p>
<p>Here&#8217;s the code:<br />
<br />
<code>#include <CapSense.h><br />
const int purr = 9;        // pin that the LED is attached to<br />
const int led = 3;        // pin that the LED is attached to<br />
const int eye1=10;<br />
const int eye2=11;<br />
const int mouth=4;<br />
boolean purring=false;<br />
boolean openEyes=false;<br />
CapSense   cs_1_2 = CapSense(1,2); </p>
<p>void setup(){<br />
  pinMode(purr, OUTPUT);<br />
  pinMode(led, OUTPUT);<br />
  pinMode(eye1, OUTPUT);<br />
  pinMode(eye2, OUTPUT);<br />
  pinMode(mouth, INPUT);<br />
  pinMode(led,OUTPUT);  </p>
<p>  pinMode(purr,OUTPUT);<br />
  digitalWrite(purr, LOW);<br />
  Serial.begin(9600);<br />
}</p>
<p>int touch_sensor(){<br />
  long start = millis();<br />
    long total1 =  cs_1_2.capSense(30);<br />
if (total1<02){<br />
  return 1;<br />
}else{<br />
  return 0;<br />
}</p>
<p>    /*Serial.print(millis() - start);        // check on performance in milliseconds<br />
    Serial.print("\t");                    // tab character for debug windown spacing</p>
<p>    Serial.print(total1);                  // print sensor output 1<br />
            // print sensor output 3</p>
<p>    delay(10); */<br />
}</p>
<p>void loop(){<br />
  int touch=touch_sensor();<br />
 if (digitalRead(mouth)){<br />
  openEyes=true;<br />
  }<br />
  else{<br />
    openEyes=false;<br />
  }</p>
<p>  if(!touch){<br />
 if(purring){<br />
      for(int i=255;i> 0;i-=10){<br />
        analogWrite(purr,i);<br />
        delay(20);<br />
      }</p>
<p>      purring=false;<br />
    }<br />
    else{<br />
      analogWrite(purr,0);<br />
      openEyes=false;<br />
    }<br />
    digitalWrite(led,LOW);</p>
<p>  }<br />
  else{<br />
    purring=true;<br />
    digitalWrite(led,HIGH);</p>
<p>    analogWrite(purr,200);<br />
      openEyes=true;</p>
<p>  }<br />
if (openEyes){<br />
   for(int i=65;i<255;i+=10){<br />
      analogWrite(eye1,i);<br />
      analogWrite(eye2,i);<br />
      delay(10);<br />
    }<br />
    for(int i=255;i>65;i-=10){<br />
      analogWrite(eye1,i);<br />
      analogWrite(eye2,i);<br />
      delay(10);<br />
    }}else{<br />
      analogWrite(eye1,0);<br />
    analogWrite(eye2,0);<br />
    }<br />
}<br />
</code><br />
<br />
Students worked on their own soft circuits this week with different enthusiasm levels. Students used to working through labs, but not producing pieces, enjoyed this assignment  far less than those who like to make crafts. Still, I believe introducing students to conductive thread and conductive fabrics will help them construct later projects.</p>
<p>We did run into a few glitches this week as well. One student plugged 12V into the freeduino. The 12V plug was used in our first experiments, and I had mentioned that the freeduino could be powered by the USB or a battery. I had extra Atmega chips and, apart from the chip, the board seemed fine.</p>
<p> Another student had trouble finding the usbserial port. At first I thought that the <strong>FTDI Drivers for Intel Macs</strong> was not installed, but then he moved to another computer with the same problem. His circuit seemed fine. In the end, it turned out that the USB cable was to blame. As soon as we switched cables, everything worked. It was a brand new cable and it surprised both of us that this was the source of the problems.</p>
<p>IPhone programming is going a bit slower than I anticipated. The class was still working on the second version of the Browser assignment this week. In the meantime, I came up with a way for students to create web pages to document their work:<br />
   <script src="http://lizarum.com/assignments/includes/codegen.js" type="text/javascript"></script></p>
<form id="mycode" method="post" action="#">
<div style="text-align:right;">
<input type="button" value="clear fields" onclick="clearFields();return true;"  />
<hr /></div>
<p></p>
<div style="black 1px solid; ">Background-color:<br /><textarea   id="bg"  rows="1" cols="40"></textarea><br />
Application name:<br /><textarea   id="ApTitle"  rows="1" cols="40"></textarea><br />
<hr />
Notes:<br /><textarea   id="notes"  rows="6" cols="40"></textarea><br />
<hr />
File Name:<br /><textarea   id="fileName"  rows="1" cols="40"></textarea><br />
<br />
Code:<br /><textarea   id="code"  rows="10" cols="40"></textarea></p>
<input type="button" value="Add code with code generator" onclick="pickOne();return true;" />
&nbsp;<br />
<span id="newpage"></span></p>
<p style="text-align:right;">
<input type="button"  id="preview" value="Page Preview" onclick="makePage()"  style="display:none;" /></p>
</div>
</form>
<p>The Blender class is going well. Students have started working with armatures and materials. They have made short quicktime movies of the experiments and everyone is still engaged in the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lizarum.com/2009/10/a-short-week/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
