<?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>ITPlay &#187; arduino</title>
	<atom:link href="http://steveaquillano.com/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>http://steveaquillano.com</link>
	<description>Work can be fun. Is it still work?</description>
	<lastBuildDate>Tue, 09 Mar 2010 15:37:10 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Graphing Analog Sensors</title>
		<link>http://steveaquillano.com/2009/10/graphing-analog-sensors/</link>
		<comments>http://steveaquillano.com/2009/10/graphing-analog-sensors/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 14:46:51 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=145</guid>
		<description><![CDATA[I am still a little bit confused about the proper code to use  when you want Arduino to send ASCII vs. binary as well as when I want Processing to read ASCII vs. binary. The Arduino Serial.print library reference has become my best friend. This is a very useful program to keep around to [...]]]></description>
			<content:encoded><![CDATA[<p>I am still a little bit confused about the proper code to use  when you want Arduino to send ASCII vs. binary as well as when I want Processing to read ASCII vs. binary. The <a href="file:///Applications/Arduino.app/Contents/Resources/Java/reference/Serial_Print.html">Arduino Serial.print library reference</a> has become my best friend. This is a very useful program to keep around to test future analog inputs and understand the mapping of their actions to the analog values they produce.</p>
<p><a  href="http://steveaquillano.com/blog/wp-content/uploads/2009/10/graphAnalogSensor.png" class="thickbox no_icon" rel="gallery-145" title="graphAnalogSensor"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/10/graphAnalogSensor.png" alt="graphAnalogSensor" title="graphAnalogSensor" width="480" height="402" class="aligncenter size-full wp-image-146" /></a></p>
<p><strong>Arduino Code:</strong><br />
<code><br />
int analogPin = 0;<br />
int analogValue = 0;</p>
<p>void setup()<br />
{<br />
  // start serial port at 9600 bps:<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
  // read analog input, divide by 4 to make the range 0-255:<br />
  analogValue = analogRead(analogPin);<br />
  //analogValue = analogValue / 4;<br />
  Serial.print(analogValue,BYTE);<br />
  // pause for 10 milliseconds:<br />
  delay(10);<br />
}</p>
<p><strong>Processing Code:</strong><br />
import processing.serial.*;</p>
<p>Serial myPort;  // The serial port<br />
int graphXPos = 1;  // The horizontal position of the graph</p>
<p>void setup() {<br />
  size(400,300);  // Window size</p>
<p>  // List all the available serial ports<br />
  println(Serial.list());</p>
<p>  myPort = new Serial(this,Serial.list()[0],9600); // Pick serial port</p>
<p>  background(48,31,65);<br />
}</p>
<p>void draw() {<br />
  // Nothing happens in draw. It all happens in SerialEvent()<br />
}</p>
<p>void serialEvent(Serial myPort) {<br />
  // Get the byte<br />
  int inByte = myPort.read();<br />
  // Print it<br />
  //println(inByte);<br />
  // Set the drawing color<br />
  stroke(123,128,158);<br />
  // Draw the line<br />
  line(graphXPos,height,graphXPos,height-inByte);<br />
  // At the edge of the screen, go back to the beginning<br />
  if(graphXPos >= width) {<br />
    graphXPos = 0;<br />
    // Clear the screen<br />
    background(48,31,65);<br />
  }<br />
  else {<br />
    // Increment the horizontal position for the next reading<br />
    graphXPos++;<br />
  }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/10/graphing-analog-sensors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Tone Output</title>
		<link>http://steveaquillano.com/2009/10/fun-with-tone-output/</link>
		<comments>http://steveaquillano.com/2009/10/fun-with-tone-output/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:57:45 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=142</guid>
		<description><![CDATA[
Arduino Code:

/*
   Theremin
 Plays tones based on a sensor reading
 uses Tone library by Brett Hagman

http://code.google.com/p/arduino-tone/

 circuit:
 * photoresistor from +5V to analog in 0
 * photoresistor from analog pin 0 to ground
 * 8-ohm speaker on digital pin 8
 created 10 Sep 2009
 by Tom Igoe
 */
#include 
Tone noiseMaker;    [...]]]></description>
			<content:encoded><![CDATA[<p><object width="549" height="302"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7212885&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7212885&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="549" height="302"></embed></object></p>
<p>Arduino Code:<br />
<code><br />
/*<br />
   Theremin</p>
<p> Plays tones based on a sensor reading<br />
 uses Tone library by Brett Hagman<br />

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 <Tone.h><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's range<br />
  // to the desired pitch range:<br />
  int pitch = map(sensorReading, 50, 800, 100, 1000);<br />
  // change the pitch:<br />
  noiseMaker.play(pitch);<br />
}<br />
</code></p>
<p>In this lab, the diagram shows the analog input as two photocells wired in series. I&#8217;m not sure I understand the analog readings produced as a result of this. For example, when both photocells were fully exposed to light the reading was about 200. When the right photocell was covered, the value jumped to 600-800. If only the left photocell was covered, it lowered the reading to about 50. If both were covered, the value leveled out around the same 200 as when they were both fully exposed. I&#8217;m not sure I understand the circuit and why these variable resisters were producing these values.</p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/10/fun-with-tone-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analog Out: Servo Motor Control</title>
		<link>http://steveaquillano.com/2009/10/analog-out-servo-motor-control/</link>
		<comments>http://steveaquillano.com/2009/10/analog-out-servo-motor-control/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 04:25:38 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=131</guid>
		<description><![CDATA[


]]></description>
			<content:encoded><![CDATA[<p><object width="551" height="303"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7156052&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7156052&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="551" height="303"></embed></object></p>
<p><object width="551" height="303"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7155877&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7155877&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="551" height="303"></embed></object></p>
<p><object width="551" height="303"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7155953&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7155953&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="551" height="303"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/10/analog-out-servo-motor-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plant Watering Alert System</title>
		<link>http://steveaquillano.com/2009/10/plant-watering-alert-system/</link>
		<comments>http://steveaquillano.com/2009/10/plant-watering-alert-system/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 04:04:18 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[sensor]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=98</guid>
		<description><![CDATA[

The alert system functions by illuminating the green LED while the plant is properly watered and switches the red LED on when the plant is in need of watering (or dry). Also, when the soil is dry and the plant is watered, the system will turn the red LED off and the green LED on.
A [...]]]></description>
			<content:encoded><![CDATA[<p><object width="551" height="303"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7105647&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=7105647&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="551" height="303"></embed></object></p>
<div id="attachment_128" class="wp-caption aligncenter" style="width: 347px"><a  href="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensor.png" class="thickbox no_icon" rel="gallery-98" title="Soil Sensor"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensor.png" alt="Soil Sensor" title="soilSensor" width="337" height="188" class="size-full wp-image-128" /></a><p class="wp-caption-text">Homemade Soil Humidity Sensor</p></div>
<div id="attachment_122" class="wp-caption alignleft" style="width: 218px"><a  href="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensorDry.png" class="thickbox no_icon" rel="gallery-98" title="Sensor reading when dry"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensorDry.png" alt="Sensor reading when dry" title="soilSensorDry" width="208" height="387" class="size-full wp-image-122" /></a><p class="wp-caption-text">Sensor reading when dry</p></div>
<div id="attachment_123" class="wp-caption alignleft" style="width: 218px"><a  href="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensorWet.png" class="thickbox no_icon" rel="gallery-98" title="Sensor reading when wet"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/10/soilSensorWet.png" alt="Sensor reading when wet" title="soilSensorWet" width="208" height="387" class="size-full wp-image-123" /></a><p class="wp-caption-text">Sensor reading when wet</p></div>
<p style="clear:both">
<p>The alert system functions by illuminating the green LED while the plant is properly watered and switches the red LED on when the plant is in need of watering (or dry). Also, when the soil is dry and the plant is watered, the system will turn the red LED off and the green LED on.</p>
<p>A small improvement to this system would be to have the green LED dim proportionally as the soil becomes more and more dry, then the red LED would ultimately turn on when the soil is completely dry.</p>
<p>A couple long-term improvements would be to (1) devise an automated watering system or (2) have the plant twitter or sms the owner&#8217;s phone to remind him/her that it needs to be watered.</p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/10/plant-watering-alert-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Physical Computing &#8211; Week 2 Lab</title>
		<link>http://steveaquillano.com/2009/09/physical-computing-week-2-lab/</link>
		<comments>http://steveaquillano.com/2009/09/physical-computing-week-2-lab/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:17:21 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=14</guid>
		<description><![CDATA[This week we studied analog inputs. In lab, I created a circuit using the Arduino to translate analog reads from a potentiometer (switch) into the brightness of an LED.






int potPin = 0; // Analog input pin that the potentiometer is attached to
int potValue = 0; // Value read from the pot
int led = 9; // [...]]]></description>
			<content:encoded><![CDATA[<p>This week we studied analog inputs. In lab, I created a circuit using the Arduino to translate analog reads from a potentiometer (switch) into the brightness of an LED.</p>
<p><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcomp-wk2-1of2.JPG" alt="pcomp-wk2-1of2" title="pcomp-wk2-1of2" width="475" height="356" class="aligncenter size-full wp-image-20" /></p>
<p><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcomp-wk2-2of2.JPG" alt="pcomp-wk2-2of2" title="pcomp-wk2-2of2" width="475" height="356" class="aligncenter size-full wp-image-15" /></p>
<p>
<img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcompwk2-1024.png" alt="pcompwk2-1024" title="pcompwk2-1024" width="250" height="280" class="alignleft size-full wp-image-17" /><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcompwk2-512.png" alt="pcompwk2-512" title="pcompwk2-512" width="250" height="280" class="alignleft size-full wp-image-18" /><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcompwk2-0.png" alt="pcompwk2-0" title="pcompwk2-0" width="250" height="280" />
</p>
<p><code></p>
<p>int potPin = 0; // Analog input pin that the potentiometer is attached to<br />
int potValue = 0; // Value read from the pot<br />
int led = 9; // PWM pin that the LED is on. n.b. PWM 0 is on digital pin 9</p>
<p>void setup() {<br />
  // Initialize serial communications at 9600 bps<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop() {<br />
  potValue = analogRead(potPin); // read teh pot value<br />
  analogWrite(led, potValue/4); // PWM the LED with the pot value (divided by 4 to fit in a byte<br />
  Serial.println(potValue); // Print the pot value back to the debugger pane<br />
  delay(10);<br />
}<br />
</code></p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6717293&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6717293&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a  href="http://vimeo.com/6717293">PComp-Wk2-Lab</a> from <a  href="http://vimeo.com/user2310172">Steve Aquillano</a> on <a  href="http://vimeo.com">Vimeo</a>.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/09/physical-computing-week-2-lab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Physical Computing &#8211; Week 1</title>
		<link>http://steveaquillano.com/2009/09/physical-computing-week-1/</link>
		<comments>http://steveaquillano.com/2009/09/physical-computing-week-1/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 12:20:55 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://steveaquillano.com/blog/?p=3</guid>
		<description><![CDATA[The purpose of our first assignment in physical computing was to become familiar with circuits, the arduino microcontroller and building circuits on a breadboard.
To begin I translated the circuit to the breadboard. Afterward I compiled and uploaded the program to the arduino microcontroller.
End result: When the switch is off, the red led is on. When [...]]]></description>
			<content:encoded><![CDATA[<p>The purpose of our first assignment in physical computing was to become familiar with circuits, the arduino microcontroller and building circuits on a breadboard.</p>
<p>To begin I translated the circuit to the breadboard. Afterward I compiled and uploaded the program to the arduino microcontroller.</p>
<p>End result: When the switch is off, the red led is on. When the circuit is switched on, the red led turns off and the yellow led turns on.</p>
<div id="attachment_5" class="wp-caption aligncenter" style="width: 485px"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcomp-wk1-1of2.JPG" alt="Switch Off" title="pcomp-wk1-1of2" width="475" height="356" class="size-full wp-image-5" /><p class="wp-caption-text">Switch Off</p></div>
<div id="attachment_6" class="wp-caption aligncenter" style="width: 485px"><img src="http://steveaquillano.com/blog/wp-content/uploads/2009/09/pcomp-wk1-2of2.JPG" alt="Switch On" title="pcomp-wk1-2of2" width="475" height="356" class="size-full wp-image-6" /><p class="wp-caption-text">Switch On</p></div>
<p>// declare variables:<br />
 int switchPin = 2;      //  digital input pin for a switch<br />
 int yellowLedPin = 3;   //  digital output pin for an LED<br />
 int redLedPin = 4;      //  digital output pin for an LED<br />
 int switchState = 0;    // the state of the switch</p>
<p> void setup() {<br />
   pinMode(switchPin, INPUT);       // set the switch pin to be an input<br />
   pinMode(yellowLedPin, OUTPUT);   // set the yellow LED pin to be an output<br />
   pinMode(redLedPin, OUTPUT);      // set the red LED pin to be an output<br />
 }</p>
<p> void loop() {<br />
   // read the switch input:<br />
   switchState = digitalRead(switchPin);</p>
<p>   if (switchState == 1) {<br />
     // if the switch is closed:<br />
     digitalWrite(yellowLedPin, HIGH);    // turn on the yellow LED<br />
     digitalWrite(redLedPin, LOW);       // turn off the red LED<br />
   }<br />
   else {<br />
     // if the switch is open:<br />
     digitalWrite(yellowLedPin, LOW);   // turn off the yellow LED<br />
     digitalWrite(redLedPin, HIGH);     // turn on the red LED<br />
   }<br />
 }</p>
<p><object width="475" height="375"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6606405&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6606405&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a  href="http://vimeo.com/6606405">PComp-Wk1-Video</a> from <a  href="http://vimeo.com/user2310172">Steve Aquillano</a> on <a  href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://steveaquillano.com/2009/09/physical-computing-week-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
