<?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>GadgetNate &#187; Electronics</title>
	<atom:link href="http://www.gadgetnate.com/category/electronics/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gadgetnate.com</link>
	<description></description>
	<lastBuildDate>Thu, 09 Feb 2012 11:24:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>TeleScrapbook</title>
		<link>http://www.gadgetnate.com/2011/08/26/telescrapbook</link>
		<comments>http://www.gadgetnate.com/2011/08/26/telescrapbook#comments</comments>
		<pubDate>Fri, 26 Aug 2011 17:21:04 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/?p=1553</guid>
		<description><![CDATA[Teaching kids the basics of electronics and programming is something that I have been working on doing through my GadgetCamps.  The GadgetCamps is 100% hands on.  Hooking up circuits, typing in code, seeing how things work.  There are many ways to make things &#8220;hands on&#8221;.  The TeleScrap Book takes a unique approach.  And it is [...]]]></description>
			<content:encoded><![CDATA[<p>Teaching kids the basics of electronics and programming is something that I have been working on doing through my <a href="http://www.GadgetCamps.com">GadgetCamps</a>.  The GadgetCamps is 100% hands on.  Hooking up circuits, typing in code, seeing how things work.  There are many ways to make things &#8220;hands on&#8221;.  The TeleScrap Book takes a unique approach.  And it is Arduino based!</p>
<p>&nbsp;</p>
<p><iframe src="http://player.vimeo.com/video/21825986?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="400" height="225"></iframe></p>
<p><a href="http://vimeo.com/21825986">TeleScrapbook</a> from <a href="http://vimeo.com/user5052454">Natalie Freed</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>More information available from:</p>
<p><a href="http://www.nataliefreed.com/?page_id=34">Creator&#8217;s website &#8211; Natalie Freed</a></p>
<p><a href="http://blog.makezine.com/archive/2011/04/telescrapbook.html">Make Magazine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/08/26/telescrapbook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Super Awesome Sylvia shows the LOL shield for the Arduino</title>
		<link>http://www.gadgetnate.com/2011/08/22/super-awesome-sylvia-shows-the-lol-shield-for-the-arduino</link>
		<comments>http://www.gadgetnate.com/2011/08/22/super-awesome-sylvia-shows-the-lol-shield-for-the-arduino#comments</comments>
		<pubDate>Tue, 23 Aug 2011 03:36:15 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/?p=1530</guid>
		<description><![CDATA[I had three weeks of Arduino camps for middle school kids. It was a big hit. Today, I see this video that has an awesome introduction to the Arduino LOL (Lots of LEDs) shield. It is a wonderful little video that will bring a smile and inspiration to anyone who watches it.]]></description>
			<content:encoded><![CDATA[<p>I had three weeks of Arduino camps for middle school kids.  It was a big hit.</p>
<p>Today, I see this video that has an awesome introduction to the Arduino LOL (Lots of LEDs) shield.  It is a wonderful little video that will bring a smile and inspiration to anyone who watches it.<br />
<iframe width="560" height="345" src="http://www.youtube.com/embed/FVRrOtP1Dvk" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/08/22/super-awesome-sylvia-shows-the-lol-shield-for-the-arduino/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Second week of GadgetCamps</title>
		<link>http://www.gadgetnate.com/2011/08/11/second-week-of-gadgetcamps</link>
		<comments>http://www.gadgetnate.com/2011/08/11/second-week-of-gadgetcamps#comments</comments>
		<pubDate>Thu, 11 Aug 2011 13:52:15 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/08/11/second-week-of-gadgetcamps</guid>
		<description><![CDATA[Last week we had 6 middle school students at our first GadgetCamp.&#160; That was just the perfect number of students for the space at the Mathnasium that we are using.&#160; The kids learned many things.&#160; How to identify the parts in their kits such as the Arduino microcontroller board, the usb cable, LEDs, resistors, wires, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week we had 6 middle school students at our first GadgetCamp.&#160; That was just the perfect number of students for the space at the Mathnasium that we are using.&#160; </p>
<p>The kids learned many things.&#160; How to identify the parts in their kits such as the Arduino microcontroller board, the usb cable, LEDs, resistors, wires, prototyping breadboards, peizo speaker, and buttons.&#160; They also learned to identify the parts of the Arduino board such as the usb connection, power connection, the digital pins, the analog pins, gnd pins, 5V pin, reset button, etc.</p>
<p>Then we go through the process of hooking up the Arduino to the computer and downloading the sample “blink” sketch.&#160; (Sketch is what an Arduino program is called in the Arduino world.)&#160; This is usually where we run into some time consuming problems due to different versions of windows, issues with the FTDI driver (FTDI makes the chip that is used to create the USB to serial connection used on the Arduino board), and issues with identifying the COM port that the Arduino is actually using.</p>
<p>Once passed, that we go through the blink sketch that turns on and off the 13th pin/connection on the board.&#160; This pin has its own LED built on the board.&#160; The blink program introduces a lot of new concepts and symbols that we go over.&#160; We learn about comments (/*&#160; */&#160; and //).&#160; Learn about the two functions that must be defined in an Arduino program (setup() and loop()).&#160; We mention that the void in the function declaration is required, but that understanding about return types of functions is something that will not be covered in this camp.&#160; The purpose of the () is mentioned, but it is not expected that this is fully grasped at this stage.&#160; We also talk about the need and purpose of {}.&#160; And we point out how every statement has to end in a ;. </p>
<p>In the Blink sketch we go over the pinMode, digitalWrite, and delay functions that are used.&#160; Then we begin altering the blink program.&#160; What happens if you comment out the first delay?&#160; The light never comes on.&#160; Why?&#160; What happens if you comment out the second delay?&#160; The light never goes off.&#160; Why?</p>
<p>Challenge:&#160; Can you make the light stay on for twice as long as it is off?&#160; (Solution:&#160; Change delay interval after the digitalWrite(13, HIGH); to be twice as much as the digitalWrite(13, LOW);)</p>
<p>Challenge:&#160; Can you make the light blink one time long and then one time short?&#160; (Solution:&#160; Copy and past the 4 lines of the blink program and alter the delay times.)</p>
<p>From here we can move into Morse code and start sending out SOS and their initials.</p>
<p>Next we switch gears and learn about the prototyping breadboard.&#160; The most difficult part is understanding how the breadboard is connected.&#160; I have some better explanations and demonstrations planned for next week.&#160; And I think one thing that will help is to have better visuals to use in class.&#160; A cut away of the board would be useful.&#160; To the students, the prototyping breadboard looks like a grid of holes.&#160; The idea that some are connected together in a certain way is something that will take experience working with the prototyping breadboard to fully grasp.</p>
<p>Next we hookup a wire from the GND pin on the Arduino to the connection running on the side of the prototyping breadboard and a connection from the 5V to the connection running on the other side.&#160; Then we try hooking up our first LED and resistor.&#160; Here it is very, very important that the cathode of the LED (the shorter pin) to the ground side, then use a resistor (200 ohms) to connect to the anode of the LED.&#160; Then the resistor goes across the middle and hooks up to the other side of the prototyping breadboard.&#160; Then we take a wire to connect the resistor to the 5V connection on the side.&#160; Then the LED glows.&#160; During this process I explain that the LED will only work one way.&#160; The shorter pin has to be hooked up to ground.&#160; The longer one has to be hooked up to V+.&#160; I have them switch around the LED to demonstrate that it will not work the other way around.</p>
<p>The reason it is important to hook it up in this fashion is that it only takes removing the wire from the 5V+ connection and reconnecting it to an Arduino digital pin to have the Arduino control the light.&#160; At this point we usually go and connect multiple LEDs.&#160; This week I gave everyone red, yellow, and green LEDs to allow them to create a traffic light.&#160; All three are hooked up on the breadboard, and then we connect them to the Arduino.&#160; Pins 13, 12, 11.&#160; Then they have to modify the blink program by adding two pinMode lines and then the necessary delay and digitalWrite lines to make the lights blink like a traffic light.&#160; In the class this week we had an additional challenge of having two sets of traffic lights and to make them come on just like a real traffic intersection.&#160; They did a really good job.</p>
<p>Also, at this point we have them hook up as many lights as they want and create a pattern of blinking lights.</p>
<p>Now we switch gears again and begin working on constructing our electronic dice.&#160; For the case we have a cardboard box.&#160; They draw two squares on it and 7 circles in each square for the places that the LEDs need to go.&#160; Then using a tack they put two holes in each circle for the leads of the LEDs to go through.&#160; Then they put the LEDs in the cubes.&#160; I have a selection of LEDs that they can choose from.&#160; Green was the most popular color this week.&#160; </p>
<p>They put in the 14 LEDs for their dice, then bend the longer lead of the LED (the anode), to hold the LED in place and to make it easier to identify the cathode (shorter lead) which all need to be connected together.&#160; I have precut black wires for them to use and to connect using a wire wrapping tool.&#160; They connect all the cathodes together.</p>
<p>Then I have them connect a long wire that is either red, yellow, or white&#160; (I’ve gone through many spools of wire…).&#160; They connect this to the anode.&#160; I also have them remove the cover for the adhesive on the small prototyping breadboard to have it attach to the bottom of the box.&#160; Then they connect all the wires to this.&#160; This will then have the resistors and then the connection to the Arduino.&#160; The idea is to make it easier to connect and disconnect the Arduino from the electronic dice so that they can use it another project.</p>
<p>The wire wrapping is the end of the first day.&#160; The first camp we were mostly done with wire wrapping the first day.&#160; This week it took a lot of time.&#160; We ended up doing a lot of wire wrapping the second day too.</p>
<p>On the second day, we checked to make sure all the lights came on.&#160; We learned about creating our own functions.&#160; Started with just creating the “dot” and “dash” function for their Morse code program.&#160; We also covered variables, == comparison, the “if” statement and the “random” function.&#160; In the first week we also covered the piezo speaker and the tone function.&#160; This week, we barely mentioned it yesterday.&#160; Also, in the first camp we had the button hooked up on day two.&#160; We have not gotten to this yet.&#160; </p>
<p>This week, we have a lot of ground to cover on the final day of camp.&#160; I write some more about it later.</p>
<p>It is great to see how smart these kids are.&#160; I want to find some way to keep them motivated and making progress.&#160; For these reason, I am setting up monthly meetings for a “Electronics and Robotics Club” at the Barbara Bush Library.&#160; I’ve created Facebook events for the meetings. You can go there to find out more:</p>
<p><a href="http://www.facebook.com/event.php?eid=117400101690689">September Meeting</a></p>
<p><a href="http://www.facebook.com/event.php?eid=204434146280902">October Meeting</a></p>
<p><a href="http://www.facebook.com/event.php?eid=267927169888882">November Meeting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/08/11/second-week-of-gadgetcamps/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting ready for our first Electronics Camp for kids</title>
		<link>http://www.gadgetnate.com/2011/07/25/getting-ready-for-our-first-electronics-camp-for-kids</link>
		<comments>http://www.gadgetnate.com/2011/07/25/getting-ready-for-our-first-electronics-camp-for-kids#comments</comments>
		<pubDate>Mon, 25 Jul 2011 20:45:28 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/?p=1518</guid>
		<description><![CDATA[We are only 1 week away from our first Electronics Camp for Kids that will teach basic circuits and programming to kids in middle school. We had our first run through today. Everything went well. Supplies for the electronics camp are coming in. I am now the the proud owner of 15 Arduino boards. We [...]]]></description>
			<content:encoded><![CDATA[<p>We are only 1 week away from our first Electronics Camp for Kids that will teach basic circuits and programming to kids in middle school.  We had our first run through today.  Everything went well.</p>
<p>Supplies for the electronics camp are coming in.  I am now the the proud owner of 15 Arduino boards.  We have hundreds of LEDs, buttons, resistors, wires and more than a dozen breadboards.  </p>
<p>We have a number of people signed up, but it would be good to have a few more.  Check out <a href="http://www.GadgetCamps.com">http://www.GadgetCamps.com</a> to learn more and sign up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/25/getting-ready-for-our-first-electronics-camp-for-kids/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow Me Game {update}</title>
		<link>http://www.gadgetnate.com/2011/07/16/follow-me-game-update</link>
		<comments>http://www.gadgetnate.com/2011/07/16/follow-me-game-update#comments</comments>
		<pubDate>Sat, 16 Jul 2011 17:10:52 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/07/16/follow-me-game-update</guid>
		<description><![CDATA[Earlier, I had published a post about my implementation of the MySimon game.&#160; Recently I got some arcade buttons and was able to make the game a lot more enjoyable to play.&#160; Here is the way it looks now:&#160; See it in the video: &#160; See the previous post:]]></description>
			<content:encoded><![CDATA[<p>Earlier, I had published a post about <a href="http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game">my implementation of the MySimon game.</a>&#160; Recently I got some arcade buttons and was able to make the game a lot more enjoyable to play.&#160; Here is the way it looks now:&#160; </p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/FollowMeGameupdate_AB45/photo.jpg"><img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="photo" border="0" alt="photo" src="http://www.gadgetnate.com/wp-content/uploads/images/FollowMeGameupdate_AB45/photo_thumb.jpg" width="244" height="185" /></a> </p>
<p>See it in the video:</p>
<p><iframe height="349" src="http://www.youtube.com/embed/74MBoTGh8Hg" frameborder="0" width="425" allowfullscreen="allowfullscreen"></iframe></p>
<p>&#160;</p>
<p><a href="http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game">See the previous post:</a></p>
<p><a href="http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game"><img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://www.gadgetnate.com/wp-content/uploads/images/FollowMeGameupdate_AB45/image.png" width="244" height="176" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/16/follow-me-game-update/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Arduino Lesson For Children: Lesson 1 &#8211; Blink Led 13</title>
		<link>http://www.gadgetnate.com/2011/07/04/first-arduino-lesson-for-children-lesson-1-blink-led-13</link>
		<comments>http://www.gadgetnate.com/2011/07/04/first-arduino-lesson-for-children-lesson-1-blink-led-13#comments</comments>
		<pubDate>Mon, 04 Jul 2011 15:09:09 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/07/04/first-arduino-lesson-for-children-lesson-1-blink-led-13</guid>
		<description><![CDATA[Today, I gave my first Arduino lesson to my sons (ages 8 and 12) and their friend (age 13).&#160; It only covered identifying parts of the arduino board, hooking the arduino to the computer, starting the IDE, using the built in blink example, changing the example to flash S.O.S. in Morse Code, refactoring the example [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I gave my first Arduino lesson to my sons (ages 8 and 12) and their friend (age 13).&#160; It only covered identifying parts of the arduino board, hooking the arduino to the computer, starting the IDE, using the built in blink example, changing the example to flash S.O.S. in Morse Code, refactoring the example so that it uses a “dot” and a “dash” function, and then writing something else in Morse Code of their choice.</p>
<p>The lesson print out is below, but let me give some insight into how it went.</p>
<p>My younger son (8 years) had some trouble with putting the “delay” command between the digitalWrite(13, HIGH) and digitalWrite(13, LOW).&#160; Delaying while the light is off made sense to him, but using it to keep the light on was counter intuitive and difficult for him to grasp.&#160; I need to find a good way to explain it.</p>
<p>My older son (12 years) had no trouble with creating the basic function.&#160; The only mistake that he had trouble with was putting the code in between () for the dot and dash functions he defined.&#160; I explained this and he was on his way.&#160; He even created a function for each letter so that he could just spell out the words using function calls like this for “hi”:</p>
<p>h();</p>
<p>i();</p>
<p>My son’s friend (13 years) had no trouble.&#160; He was able to do the morse code with no trouble.&#160; </p>
<p>I think all in all, this lesson would work out best for 6 grade and above..</p>
<p>&#8212;-Lesson 1&#8212;&#8211;</p>
<h3>Arduino Lesson 1 – Blinking LED 13</h3>
<p>Learning Objectives:</p>
<p>· How to hookup the Arduino to the computer</p>
<p>· How to open the Arduino IDE</p>
<p>· How to type a simple program into the Arduino IDE that blinks the built in light on the board</p>
<p>· Learn the basic syntax and structure of an Arduino program (Arduino programs are called sketchs)</p>
<p>· Learn the commands pinMode, digitWrite, delay</p>
<p>· Learn how to define a function</p>
<p>What you will need:</p>
<p>· Computer</p>
<p>· USB cable</p>
<p>· Arduino Duemilanove Board</p>
<p>· Arduino software (assumed to already be installed on the computer)</p>
<p>Activity 1: Take a look at the Arduino board</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/FirstArduinoLessonForChildrenLesson1Blin_8EBE/clip_image002.jpg"><img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" align="left" src="http://www.gadgetnate.com/wp-content/uploads/images/FirstArduinoLessonForChildrenLesson1Blin_8EBE/clip_image002_thumb.jpg" width="244" height="176" /></a></p>
<p>Try to identify the following items: </p>
<p>· Digital pins 0-13</p>
<p>· GND pins (how many of them are there?) </p>
<p>· 5V</p>
<p>· 3V</p>
<p>· Analog In 0-5</p>
<p>· Pins marked PWM</p>
<p>· Pins marked “TX” and “RX”</p>
<p>· Pin marked Reset</p>
<p>· Pin marked Aref</p>
<p>· USB connection</p>
<p>· Power connection</p>
<p>· ICSP pins</p>
<p>· Reset-EN label</p>
<p>· Reset button</p>
<p>· Lights marked “L”, TX, RX, PWR</p>
<p>What do the following terms mean:</p>
<p>Digital</p>
<p>Analog</p>
<p>GND</p>
<p>5V</p>
<p>3V</p>
<p>PWM</p>
<p>TX </p>
<p>RX</p>
<p>Reset</p>
<p>(aref we will learn about later)</p>
<p>Activity 2: Connect the Arduino to the computer using the USB cable. Which lights come on? What do you think that means?</p>
<p>Activity 3: Open up the Arduino IDE. Go to the “file” menu, choose “examples”, then “basic”, then “blink”</p>
<p>Take a moment to look at this program. This is written in a computer language called “C”. There are several things that you should know about “C”</p>
<p>1. It is case sensitive. So “hello” is different than “Hello”. (notice the first one has a lower case ‘h’ and the second one has a upper case ‘H’)</p>
<p>2. Every statement must end with a semicolon “;”. What is a statement? A statement is a command that you give to the computer. Look at every line that ends with “;” to see examples of statements</p>
<p>3. function are commands that are built in and that you can define yourself. There are two functions that are defined here: setup and loop. These are very special to the arduino. When defining a function you have to specify if the function will “return” a value. Since these do not return a value, you see that “void” is listed before their names. Do not worry about understanding this now. It will make more sense later.</p>
<p>4. After the function name is defined there is a set of () with nothing in them. This is where the parameters of the function will go. “setup” and “loop” do not take parameters so they are blank. Again, do not worry about understanding it now. It will make more sense later.</p>
<p>5. The actual code of the function is contained within in braces: {}</p>
<p>The “setup” function gets called one time.</p>
<p>The “loop” function gets called over and over and over again.</p>
<p>Take a look at this program. Can you figure out what it does?</p>
<p>In the setup function there is a statement: pinMode(13, OUTPUT); This set the Digital Pin 13 to be in Output mode. This means we will be sending a value to this pin. You could specify INPUT which would mean that you would want to “read” a value from this pin. This we will do when we get to buttons.</p>
<p>In the loop, there are two functions used: digitalWrite and delay. digitalWrite will turn “on” the pin when it is “HIGH” and turn “off” the pin when it is “LOW”. delay will wait the specified number of milliseconds before the program continues.</p>
<p>How many milliseconds are in a second?</p>
<p>How about in 10 seconds?</p>
<p>How about in a minutes?</p>
<p>Activity 4: Upload the sketch to the arduino and see what happens. Do this by click “file” and then “upload to I/O board”.</p>
<p>Notice which lights blink as it is uploaded. Then what happens. Does it do what you thought it would?</p>
<p>Click the “reset” button. Now what happens?</p>
<p>Activity 5: Blink S.O.S in Morse Code.</p>
<p>SOS is dot dot dot dash dash dash dot dot dot wait and then repeat it again.</p>
<p>Dots mean that the light is on for a short time, and dots mean the light is on for a long time. How can you modify this program to make the lights blink this way?</p>
<p>Activity 6: Use a function to make our code nicer.</p>
<p>See how we use the digitalWrite(13,High), delay(…), digitaWrite(13, LOW), delay(…) over and over again for the dash and the dot. And in our code it is difficult to make out where the dots are and where the dashes are.</p>
<p>Let’s make our code easier to read by defining two functions, and then using them.</p>
<p>Define one function called dot like this:</p>
<p>void dot() {</p>
<p>…. Put the code here to make a ‘dot’</p>
<p>}</p>
<p>And one for dash like this:</p>
<p>void dash(){</p>
<p>… put the code for a dash here</p>
<p>}</p>
<p>Now our loop function should read</p>
<p>void loop() {</p>
<p>dot();</p>
<p>dot();</p>
<p>dot();</p>
<p>dash();</p>
<p>dash();</p>
<p>dash();</p>
<p>dot();</p>
<p>dot();</p>
<p>dot();</p>
<p>}</p>
<p>Notices how the dots all blend together? How can we fix that?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/04/first-arduino-lesson-for-children-lesson-1-blink-led-13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control LEDs over the wireless network using Arduino and WiShield</title>
		<link>http://www.gadgetnate.com/2011/07/03/control-leds-over-the-wireless-network-using-arduino-and-wishield</link>
		<comments>http://www.gadgetnate.com/2011/07/03/control-leds-over-the-wireless-network-using-arduino-and-wishield#comments</comments>
		<pubDate>Sun, 03 Jul 2011 17:35:20 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/07/03/control-leds-over-the-wireless-network-using-arduino-and-wishield</guid>
		<description><![CDATA[The Arduino microprocessor is a very affordable embedded systems solution.&#160; It costs about $20 per unit, and can be program easily in C.&#160; It has easy access to digital input and output pins, as well as analog input pins.&#160; In combination with the WiShield it allows for you to control lights, motors, and more over [...]]]></description>
			<content:encoded><![CDATA[<p>The Arduino microprocessor is a very affordable embedded systems solution.&#160; It costs about $20 per unit, and can be program easily in C.&#160; It has easy access to digital input and output pins, as well as analog input pins.&#160; In combination with the WiShield it allows for you to control lights, motors, and more over the network as well as monitor temperature, humidity, noise, etc.&#160; </p>
<p>This video provides a basic demonstration of controlling three LED lights over the wifi network at my home via a web browser on the iPhone.&#160; This provides the very basics of what you need to get started with the WiShield and controlling things over the wireless network.&#160; </p>
<p>Here is a picture of the Arduino completely disconnected from the computer.&#160; It is being powered by a 9Volt battery and is completely portable.</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/IMG_9300.jpg"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_9300" border="0" alt="IMG_9300" align="left" src="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/IMG_9300_thumb.jpg" width="244" height="164" /></a> </p>
<p>Here is a video demonstrating the Arduino + WiShield in action:</p>
<p><iframe height="349" src="http://www.youtube.com/embed/axLuUn6BEnM" frameborder="0" width="425" allowfullscreen="allowfullscreen"></iframe></p>
<p>By going to the following webpage on any computer in my home network, I am able to control the state of the lights:</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image.png"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image_thumb.png" width="244" height="141" /></a> </p>
<p>Before giving you the code and circuit layout, let me tell you a little about the journey to this point.</p>
<p>I saw the WiShield on eBay I saw the LinkSprite CuHead WiFi Shield for Arduino for sale for $55 + $5 shipping.&#160; I thought it would be worth experimenting with.&#160; (As of 7/3/2011 it can still be bought on ebay <a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item=110708459270#ht_2643wt_923">http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item=110708459270#ht_2643wt_923</a>)&#160; Here is some critical information from the ebay listing:</p>
<blockquote><p>This is the shield you need to get Wi-Fi connectivity to your Arduino-based project! This shield provides 802.11b connectivity and is a direct drop-on plug-and-play solution to your Arduino Diecimila/Duemilanove/Uno.</p>
<p><strong><em>Compatible with Asynclab wifi shield!</em></strong></p>
<p><strong>Shield Features</strong></p>
<ul>
<li>Add-on shield built for Arduino Diecimila, Duemilanove and Uno
<ul>
<li>Dimensions, shape, even color match exactly! </li>
<li>True plug-n-play solution </li>
</ul>
</li>
<li>Uses SPI for host communication (max speed 25MHz) </li>
<li>All Arduino headers brought out for easy access </li>
<li>Easy access reset button on-board </li>
<li>On-board PCB antenna </li>
<li>Switchable interrupt pin usage between INT0 and digital pin 8 </li>
<li>Switchable LED on digital pin 9 </li>
<li>Switchable CS pin for serial flash between digital pin 10 and digital pin 7<sup>[1]</sup> </li>
</ul>
<h4><strong>Wi-Fi Module Features</strong></h4>
<ul>
<li>802.11b Wi-Fi certified
<ul>
<li>1Mbps and 2Mbps throughput speeds </li>
</ul>
</li>
<li>Supports both infrastructure (BSS) and ad hoc (IBSS) wireless networks </li>
<li>Ability to create secured and unsecured networks
<ul>
<li>WEP (64-bit and 128-bit) </li>
<li>WPA/WPA2 (TKIP and AES) PSK </li>
</ul>
</li>
<li>Low power usage
<ul>
<li>Sleep mode: 250μA </li>
<li>Transmit: 230mA </li>
<li>Receive: 85mA </li>
</ul>
</li>
</ul>
<h4><strong>Pin Usage</strong></h4>
<ul>
<li>SPI
<ul>
<li>Slave select (SS) : Arduino pin 10 (port B, pin 2) </li>
<li>Clock (SCK) : Arduino pin 13 (port B, pin 5) </li>
<li>Master in, slave out (MISO) : Arduino pin 12 (port B, pin 4) </li>
<li>Master out, slave in (MOSI) : Arduino pin 11 (port B, pin 3) </li>
</ul>
</li>
<li>Interrupt (Uses only one of the following, depending on jumper setting)
<ul>
<li>INT0 : Arduino pin 2 (port D, pin 2) </li>
<li>DIG8 : Arduino pin 8 (port B, pin 0) </li>
</ul>
</li>
<li>LED : Arduino pin 9 (port B, pin 1)
<ul>
<li>To regain use of this pin, remove the LED jumper cap </li>
</ul>
</li>
<li>5V power </li>
<li>GND </li>
</ul>
<p>If you setup the serial dataflash CS pin to use pin 10, then the WiFi module will <strong>not</strong> be usable.&#160; In order to use the dataflash and WiFi concurrently, the dataflash jumper CS pin must be set to pin 7.</p>
<p><strong>Download:</strong></p>
<p><a href="http://www.linksprite.com/download/showdownload.php?id=103&amp;lang=en">Schematics</a></p>
</blockquote>
<p>&#160;</p>
<p>Several key things that I should have realized from this listing that would have saved me a lot of time.&#160; </p>
<p>First thing I should have read was “<strong><em>Compatible with Asynclab wifi shield!</em></strong>”&#160; This would have led me to the <a href="http://asynclabs.com/wiki/index.php?title=AsyncLabsWiki">AsyncLabs Wiki</a> and would have saved me a lot of time.&#160; And it would have led me to download the needed library and example files from the <a href="https://github.com/asynclabs/WiShield">GitHub repository</a>.&#160; Installing these files just required putting them in the “libraries” folder under the “arduino” folder on my PC.&#160; </p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image_3.png"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image_thumb_3.png" width="213" height="490" /></a>&#160;</p>
<p>Once I did this, I saw the example sketches (arduino programs) in the IDE:</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image_4.png"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.gadgetnate.com/wp-content/uploads/images/ControlLEDsoverthewirelessnetworkusingAr_B0F9/image_thumb_4.png" width="325" height="484" /></a> </p>
</p>
<p>At first none of the examples would work except the “WebServer” example.&#160; Everything else gave me compile errors.&#160; The missing part was this note on <a href="http://asynclabs.com/wiki/index.php?title=WebServer_sketch">http://asynclabs.com/wiki/index.php?title=WebServer_sketch</a>:</p>
<blockquote><p><b>IMPORTANT NOTE:</b></p>
<p>The WiShield library includes support for both server and client applications. The individual apps are included as sample sketches but to switch between the two will require rebuilding the WiShield library as it requires reconfiguration of some variables. The library is configured as a webserver by default. To switch between modes:</p>
<ul>
<li>Uncomment the appropriate mode, APP_WEBSERVER or APP_WEBCLIENT in the apps-conf.h file in the WiShield directory.        </li>
</ul>
</blockquote>
<p>Depending on the mode you want the WiFi module to run, you have to comment out and uncomment out lines in the apps-conf.h file in the WiShield library folder.&#160; It continues with this note:</p>
<ul>
<ul>
<li>Delete all the object files (files with an extension of &#8216;.o&#8217;) in the WiShield directory. </li>
<li>Delete the &#8216;applet&#8217; directory in the WiShield/examples/WebServer/ or WiShield/examples/WebClient/ directories. </li>
<li>Restart the Arduino IDE to rebuild the library in the appropriate mode. </li>
</ul>
</ul>
<p>I could not find any “.o” files or “applet” directory to delete.&#160; I did restart the Arudino IDE, but I am not 100% sure this was required.</p>
<p>At the top of all the examples, there is this section of code that you need to configure for your network:</p>
<blockquote><p>// Wireless configuration parameters &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />unsigned char local_ip[] = {192,168,1,22};&#160;&#160;&#160; // IP address of WiShield       <br />unsigned char gateway_ip[] = {192,168,1,1};&#160;&#160;&#160; // router or gateway IP address       <br />unsigned char subnet_mask[] = {255,255,255,0};&#160;&#160;&#160; // subnet mask for the local network       <br />const prog_char ssid[] PROGMEM = {“ssid&quot;};&#160;&#160;&#160;&#160;&#160;&#160;&#160; // max 32 bytes </p>
<p>unsigned char security_type = 3;&#160;&#160;&#160; // 0 &#8211; open; 1 &#8211; WEP; 2 &#8211; WPA; 3 &#8211; WPA2 </p>
<p>// WPA/WPA2 passphrase      <br />const prog_char security_passphrase[] PROGMEM = {&quot;passphrase&quot;};&#160;&#160;&#160; // max 64 characters </p>
<p>// WEP 128-bit keys      <br />// sample HEX keys       <br />prog_uchar wep_keys[] PROGMEM = { 0&#215;01, 0&#215;02, 0&#215;03, 0&#215;04, 0&#215;05, 0&#215;06, 0&#215;07, 0&#215;08, 0&#215;09, 0x0a, 0x0b, 0x0c, 0x0d,&#160;&#160;&#160; // Key 0       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00,&#160;&#160;&#160; // Key 1       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00,&#160;&#160;&#160; // Key 2       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00&#160;&#160;&#160; // Key 3       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>
</blockquote>
<p>Set the IP address and the default gateway according to your network.&#160; The SSID needs to be replaced with the name of your wifi network.</p>
<p>The “security_type” needs to be set according to your network.&#160; It supports “open”, “WEP”, “WPA”, and “WPA2”.&#160; On my network, I run WPA2, so I set this to “3” as indicated in the comment by this value in the code above.</p>
<p>WPA2 only requires a passphrase, which I put where it says {“passphrase”} above.</p>
<p>Now for the example.&#160; Let’s get the wiring done first.&#160; I hooked up three LEDs each has a 200 ohm resistor and then connected to ground.&#160; The positive pin of the LED I have hooked up to pin 7 for green, pin 6 for white/blue, pin 5 for red.&#160; I originally tried pin 2, but this pin is used by the WiShield and would not work.&#160; (That is the other piece of critical information that I needed from the eBay listing, which pins are being used.)</p>
<p>Now here is the code for the project, (minus all the security information for my network):</p>
<p>/*   <br /> * A simple sketch that uses WiServer to serve a web page    <br /> */ </p>
<p>#include &lt;WiServer.h&gt; </p>
<p>#define WIRELESS_MODE_INFRA&#160;&#160;&#160; 1   <br />#define WIRELESS_MODE_ADHOC&#160;&#160;&#160; 2 </p>
<p>// Wireless configuration parameters &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-   <br />unsigned char local_ip[] = {192,168,1,22};&#160;&#160;&#160; // IP address of WiShield    <br />unsigned char gateway_ip[] = {192,168,1,1};&#160;&#160;&#160; // router or gateway IP address    <br />unsigned char subnet_mask[] = {255,255,255,0};&#160;&#160;&#160; // subnet mask for the local network    <br />const prog_char ssid[] PROGMEM = {&quot;ssid&quot;};&#160;&#160;&#160;&#160;&#160;&#160;&#160; // max 32 bytes </p>
<p>unsigned char security_type = 3;&#160;&#160;&#160; // 0 &#8211; open; 1 &#8211; WEP; 2 &#8211; WPA; 3 &#8211; WPA2 </p>
<p>// WPA/WPA2 passphrase   <br />const prog_char security_passphrase[] PROGMEM = {&quot;passphrase&quot;};&#160;&#160;&#160; // max 64 characters </p>
<p>// WEP 128-bit keys   <br />// sample HEX keys    <br />prog_uchar wep_keys[] PROGMEM = { 0&#215;01, 0&#215;02, 0&#215;03, 0&#215;04, 0&#215;05, 0&#215;06, 0&#215;07, 0&#215;08, 0&#215;09, 0x0a, 0x0b, 0x0c, 0x0d,&#160;&#160;&#160; // Key 0    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00,&#160;&#160;&#160; // Key 1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00,&#160;&#160;&#160; // Key 2    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00&#160;&#160;&#160; // Key 3    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }; </p>
<p>// setup the wireless mode   <br />// infrastructure &#8211; connect to AP    <br />// adhoc &#8211; connect to another WiFi device    <br />unsigned char wireless_mode = WIRELESS_MODE_INFRA; </p>
<p>unsigned char ssid_len;   <br />unsigned char security_passphrase_len;    <br />// End of wireless configuration parameters &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- </p>
<p>int redState = 0;   <br />int whiteState = 0;    <br />int greenState = 0; </p>
<p>int redPin = 5;   <br />int whitePin = 6;    <br />int greenPin = 7; </p>
<p>// This is our page serving function that generates web pages   <br />boolean sendMyPage(char* URL) {    <br />&#160;&#160;&#160; if (strcmp(URL, &quot;/red&quot;) == 0) redState = !redState;    <br />&#160;&#160;&#160; if (strcmp(URL, &quot;/white&quot;) == 0) whiteState = !whiteState;    <br />&#160;&#160;&#160; if (strcmp(URL, &quot;/green&quot;) == 0) greenState = !greenState;    <br />&#160;&#160;&#160; digitalWrite(redPin, redState);    <br />&#160;&#160;&#160; digitalWrite(whitePin, whiteState);    <br />&#160;&#160;&#160; digitalWrite(greenPin, greenState);    <br />&#160;&#160;&#160; // Check if the requested URL matches &quot;/&quot;    <br />&#160;&#160; // if (strcmp(URL, &quot;/&quot;) == 0) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Use WiServer&#8217;s print and println functions to write out the page content    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;&lt;html&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;Light Control&lt;br&gt;&lt;br&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; printLightStatus(&quot;red&quot;, redState);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; printLightStatus(&quot;white&quot;, whiteState);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; printLightStatus(&quot;green&quot;, greenState);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;The page you requested was: &quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(URL);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;&lt;br&gt;The arduino has been running for: &quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(millis());    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot; milliseconds&lt;br&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;&lt;/html&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // URL was recognized    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return true;    <br />&#160;&#160;&#160; //}    <br />&#160;&#160;&#160; // URL not found    <br />&#160;&#160;&#160; return false;    <br />} </p>
<p>void printLightStatus( String lightName, int lightState) {   <br />&#160; WiServer.print(lightName);    <br />&#160; WiServer.print(&quot; Light is &quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(lightState ==0) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot; &lt;b&gt;off&lt;/b&gt; &lt;a href=/&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(lightName);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;&gt;Turn On&lt;/a&gt;&lt;br&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot; &lt;b&gt;on&lt;/b&gt; &lt;a href=/&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(lightName);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WiServer.print(&quot;&gt;Turn off&lt;/a&gt;&lt;br&gt;&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />} </p>
<p>void setup() {   <br />&#160; // Initialize WiServer and have it use the sendMyPage function to serve pages    <br />&#160; WiServer.init(sendMyPage);    <br />&#160; // Enable Serial output and ask WiServer to generate log messages (optional)    <br />&#160; Serial.begin(57600);    <br />&#160; WiServer.enableVerboseMode(true);    <br />&#160; pinMode(redPin, OUTPUT);    <br />&#160; pinMode(whitePin, OUTPUT);    <br />&#160; pinMode(greenPin, OUTPUT);    <br />} </p>
<p>void loop(){ </p>
<p>&#160; // Run WiServer   <br />&#160; WiServer.server_task();    <br />&#160; delay(10);    <br />}</p>
<p>&#160;</p>
<p>Several other things to note.&#160; On the board it says “Copperhead WiFi Shield”.&#160; However, on the net, it is referred to only as “CuHead Wifi Shield”.&#160; (Cu being the atomic symbol for Copper.&#160; This was very frustrating, as I could not find any information about the Copperhead Wifi Shield…. Lots of stuff on Copperheads but nothing related to WiFi or Arduinos <img src='http://www.gadgetnate.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).&#160; Also, it has the link <a href="http://www.linksprite.com">http://www.linksprite.com</a> on the board, but I found the <a href="http://AsyncLabs.com">http://AsyncLabs.com</a> to be the place to get my answers.</p>
<p>If you find a cheaper place to get the WiShield, please leave a comment and let me know.&#160; It would open up a whole lot more possibilities if it was possible to get WiFi connectivity in the $20 range.&#160; </p>
<p>Also, if you know some really cool projects using the WiShield, let me know that too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/03/control-leds-over-the-wireless-network-using-arduino-and-wishield/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Cookbook (part 2) &#8211; What was left out and other information from the preface</title>
		<link>http://www.gadgetnate.com/2011/07/03/arduino-cookbook-part-2-what-was-left-out-and-other-information-from-the-preface</link>
		<comments>http://www.gadgetnate.com/2011/07/03/arduino-cookbook-part-2-what-was-left-out-and-other-information-from-the-preface#comments</comments>
		<pubDate>Sun, 03 Jul 2011 15:44:54 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/07/03/arduino-cookbook-part-2-what-was-left-out-and-other-information-from-the-preface</guid>
		<description><![CDATA[Let’s continue going through the Arduino Cookbook by Michael Margolis.&#160; (see the first article about the book.) The book doesn’t cover much electronics theory and practice, but provides some basic guidance.&#160; If you want some more background in this area, then these books are recommended: • Make: Electronics by Charles Platt (O’Reilly) • Getting Started [...]]]></description>
			<content:encoded><![CDATA[<p>Let’s continue going through the <a href="http://www.amazon.com/gp/product/0596802471/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0596802471">Arduino Cookbook by Michael Margolis</a>.&#160; (see the <a href="http://www.gadgetnate.com/2011/07/01/arduino-cookbook-by-michael-margolis">first article about the book</a>.)</p>
<p>The book doesn’t cover much electronics theory and practice, but provides some basic guidance.&#160; If you want some more background in this area, then these books are recommended:</p>
<p>• <a href="http://www.amazon.com/gp/product/0596153740/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0596153740">Make: Electronics by Charles Platt (O’Reilly)</a>     <br />• <a href="http://www.amazon.com/gp/product/0945053282/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0945053282">Getting Started in Electronics by Forrest Mims</a> (Master Publishing)     <br />• <a href="http://www.amazon.com/gp/product/159200346X/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=159200346X">Physical Computing by Dan O’Sullivan and Tom Igoe</a> (Cengage)     <br />• <a href="http://www.amazon.com/gp/product/0071452818/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0071452818">Practical Electronics for Inventors by Paul Scherz</a> (McGraw-Hill)</p>
<p>These all look like good books to go through, and we might have future series going through these books.&#160; I recognized the <a href="http://www.amazon.com/gp/product/0945053282/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0945053282">Getting Started in Electronics by Forrest Mims</a>.&#160; I had bought it nearly 25 years ago!!&#160; And I still have that copy.&#160; I was going through it with my children (ages 8 and 12) this summer.&#160; It has some wonderful illustrations in it.&#160; Here are some pictures to give you a sense:</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/ArduinoCookbookpart2Whatwasleftoutandoth_8FFE/IMG_9283.jpg"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_9283" border="0" alt="IMG_9283" src="http://www.gadgetnate.com/wp-content/uploads/images/ArduinoCookbookpart2Whatwasleftoutandoth_8FFE/IMG_9283_thumb.jpg" width="644" height="432" /></a> <a href="http://www.gadgetnate.com/wp-content/uploads/images/ArduinoCookbookpart2Whatwasleftoutandoth_8FFE/IMG_9282.jpg"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_9282" border="0" alt="IMG_9282" src="http://www.gadgetnate.com/wp-content/uploads/images/ArduinoCookbookpart2Whatwasleftoutandoth_8FFE/IMG_9282_thumb.jpg" width="644" height="431" /></a> </p>
<p>The Arduino Cookbook explains code to do very specific things.&#160; The author recommends the following books to give you more information on programming in general and C in particular:</p>
<p>• <a href="http://www.amazon.com/gp/product/1565923065/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=1565923065">Practical C Programming by Steve Oualline</a> (O’Reilly)     <br />• <a href="http://www.amazon.com/gp/product/0201183994/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0201183994">A Book on C by Al Kelley and Ira Pohl</a> (Addison-Wesley)</p>
<p><a href="http://www.amazon.com/gp/product/0131103628/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0131103628">The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie(Prentice Hall)</a></p>
<p>The code in the Arduino Cookbook has been tested with release versions 0018 through 0020.&#160; It was written before v1.0 was finalized.&#160; There might be small changes required to make the code work, and we are directed to this website:</p>
<p><a title="http://www.oreilly.com/catalog/9780596802479/" href="http://www.oreilly.com/catalog/9780596802479/">http://www.oreilly.com/catalog/9780596802479/</a></p>
<p>So, if you have doubled checked, and tripled checked something from the book, and it does not work as expected, then check the link above to see if there are some changes required.&#160; There is also an Appendix on troubleshooting, and more help can always be found from: <a href="http://www.arduino.cc">http://www.arduino.cc</a> </p>
<p>In the section “Using Code Examples” it says:</p>
<blockquote><p>This book is here to help you make things with Arduino. In general, you may use the code in this book in your programs and documentation. You do not need to contact     <br />us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from this book does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. </p>
<p>We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Arduino Cookbook by Michael Margolis     <br />with Nick Weldin (O’Reilly). Copyright 2011 Michael Margolis and Nicholas Weldin, 9780596802479.”</p>
<p>If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at <a href="mailto:permissions@oreilly.com">permissions@oreilly.com</a>.</p>
</blockquote>
<p>In this set of blog posts, I will be going through the book, page by page, but we will not be putting the information in the book on this page.&#160; Instead I will be providing some feedback, additional information, and my own personal experiments related to the information in the book.&#160; Therefore, you will want to get the book in order to make best use of these blog posts.&#160; Please use the link below so that we can get a small commission from Amazon to help support this site and the buying of all the Arduino related materials that we need to keep experimenting:</p>
<p><a href="http://www.amazon.com/gp/product/0596802471/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0596802471">Arduino Cookbook</a><img style="border-bottom: medium none; border-left: medium none; margin: 0px; border-top: medium none; border-right: medium none" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=&amp;l=as2&amp;o=1&amp;a=0596802471&amp;camp=217145&amp;creative=399369" width="1" height="1" /> </p>
<p><iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=gadgetnate-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0596802471" frameborder="0" marginwidth="0" scrolling="no"></iframe> </p>
<p>If you like online versions of things, then you should check out Safari Books Online: </p>
<p> <a title=" http://my.safaribooksonline.com." href=" http://my.safaribooksonline.com.">http://my.safaribooksonline.com.   <br /></a>
<p>This is actually how I am reading the book, free through a service provided by my local library (<a href="http://www.hcpl.net/">http://www.hcpl.net/</a>).&#160; It is a great way to get technical books, that are searchable, without having to find a place to store them.&#160;&#160;&#160; It can be great when doing some of the examples having the ability to copy and paste from the electronic book to the code editor without having to type it in, or try to find an alternate resource to get it from.</p>
<p>The Acknowledgments section can sometimes be very useful to read.&#160; There are several people that Michael thanks:</p>
<p>Nick Weldin</p>
<p><a href="http://www.simonstl.com/">Simon St. Laurent</a> – editor at O’Reilley</p>
<p>Brian Jepson (<a href="https://twitter.com/#!/bjepson">twitter</a>)– helped to provide the Xbee content in chapter 14 </p>
<p>Audrey Doyle – fixed typos and grammatical errors</p>
<p>Philip Lindsay – chapter 15 help – how to make Ethernet more understandable</p>
<p><a href="http://arduiniana.org/">Mikal Hart</a> – GPS recipes and software serial</p>
<p>Core Arduino development team: <a href="http://arduino.cc/en/Profiles/MassimoBanzi">Massimo Banzi</a>, David Cuartielles (<a href="http://twitter.com/#%21/dcuartielles">twitter</a>), Tom Igoe, Gianluca Martino, and <a href="http://dam.mellis.org/">David Mellis</a></p>
<p>Alexandra Deschamps-Sonsino, CEO of Tinker London (has workshops for the Arduino)</p>
<p>Peter Knight</p>
<p><a href="http://www.sparkfun.com/">SparkFun</a></p>
<p><a href="http://www.makershed.com/Default.asp">Maker Store</a></p>
<p><a href="http://www.gravitech.us/">Gravitech</a></p>
<p><a href="http://www.nkcelectronics.com/">NKC Electronics</a></p>
<p><a href="http://shop.moderndevice.com/">Modern Device</a></p>
<p><a href="http://www.liquidware.com/">Liquidware</a></p>
<p><a href="http://www.adafruit.com/">Adafruit</a></p>
<p><a href="http://www.makerbot.com/">Makerbot Industries</a></p>
<p><a href="http://www.mindkits.co.nz/">Mindkits</a></p>
<p><a href="http://www.oomlout.com/a/">Oomlout</a></p>
<p><a href="http://www.skpang.co.uk/catalog/">SK Pang</a></p>
<p><a href="http://www.brockcraft.com/">Brock Craft</a></p>
<p><a href="http://www.danielsoltis.com/Recent_Work.html">Daneil Soltis</a></p>
<p>(families of the writers)</p>
<p>Joshua Nobel for his book <a href="http://www.amazon.com/gp/product/0596154143/ref=as_li_ss_tl?ie=UTF8&amp;tag=gadgetnate-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0596154143">Programming Interactivity:&#160; A Designer’s Guide to Processing, Arduino, and Openframeworks</a> (published July 28, 2009)&#160; (This looks like a good book for us to go through too)</p>
<p>In the next post, we will get into Chapter 1 – Getting started…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/03/arduino-cookbook-part-2-what-was-left-out-and-other-information-from-the-preface/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Cookbook by Michael Margolis</title>
		<link>http://www.gadgetnate.com/2011/07/01/arduino-cookbook-by-michael-margolis</link>
		<comments>http://www.gadgetnate.com/2011/07/01/arduino-cookbook-by-michael-margolis#comments</comments>
		<pubDate>Sat, 02 Jul 2011 00:12:25 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/07/01/arduino-cookbook-by-michael-margolis</guid>
		<description><![CDATA[&#160; In order to bring some structure to my experiments with the Arduino, and to help me get through the learning curve quicker, I thought it would be good to have a book to guide me.&#160; The book I have selected is the Arduino Cookbook by Michael Margolis.&#160; It is a recent book, published in [...]]]></description>
			<content:encoded><![CDATA[</p>
<p><iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=gadgetnate-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0596802471" frameborder="0" marginwidth="0" scrolling="no"></iframe>&#160; </p>
<p>In order to bring some structure to my experiments with the Arduino, and to help me get through the learning curve quicker, I thought it would be good to have a book to guide me.&#160; The book I have selected is the Arduino Cookbook by Michael Margolis.&#160; It is a recent book, published in March 2011.&#160; The first words of the preface say just what I am looking for.&#160; “This book was written to help you explore the amazing things you can do with Arduino.” Yay</p>
<p>Preface</p>
<p>Arduino is a family of microcontrollers (tiny computers).&#160; It can be used for “physical computing”.&#160; Actually responding to and interacting with the “real world”.</p>
<p>This book is aimed at a broad range of people.&#160; There is no assumption about a particular hardware or software background.&#160; But even if you have a microcontroller background or a background in C/C++, you will still find this book very useful.</p>
<p>What does this book cover?</p>
<p>Chapter 1 – Getting Started – (everything you need to get that first program written, that first circuit created, and possibly even that first LED blinking?)</p>
<p>Chapter 2 – Making the Sketch Do Your Bidding.&#160; (“sketches” are what we call the Arduino program)&#160; This chapter covers the key software concepts and task.</p>
<p>Chapter 3 – Using Mathematical Operators</p>
<p>Chapter 4 – Serial Communications – how to connect to the computer and other devices using a serial connection.</p>
<p>Chapter 5 – Simple Digital and Analog Input – how to actually get the data into the arduino</p>
<p>Chapter 6 – Getting Input from Sensors – enable touch, sound, position, heat, and light</p>
<p>Chapter 7 – Visual Output – controlling LEDS (ok, looks like they wait until this chapter to get that first LED blinking?)&#160; Switch on one or many LEDs, controlling brightness and color.&#160; How to create bar graphs, numeric LED displays, create patterns, animations with LED arrays.</p>
<p>Chapter 8 – Physical output .. how to make things move with solenoids (I’ve never quite understood what a solenoid is…)&#160; servo motors (got some of them floating around… will be good to put them to some good use… found some for sale on eBay for just a few cents too.&#160; but possibly will not win those)&#160; Physical output is where the rubber meets the road.&#160; This is where we make things move!&#160; Can’t wait till we get to chapter 8!!!</p>
<p>Chapter 9 – Audio Output – generate sounds by playing wav files and MIDI output.</p>
<p>Chapter 10 – Remotely Controlling External Devices – interact with the TV, cameras, garage doors, appliances, toys.&#160; </p>
<p>Chapter 11 – Using Displays – interfacing with text and graphical LCD displays</p>
<p>Chapter 12 – Using Time and Dates – measuring time; handling time delays (here we will learn what we need to know to develop a clock, timer, and I could create a speech timer for my toastmaster club…)</p>
<p>Chapter 13 – Communicating using I2C and SPI&#160; (I have did one project in the Parallax Basic stamp book using I2C.&#160; I understand it is a protocol to connect things together.&#160; I am completely unfamiliar with SPI…)</p>
<p>Chapter 14 – Wireless Communication – using XBee </p>
<p>Chapter 15 – Ethernet and Networking – hook up things to the Internet.&#160; (I have been playing around with the EtherShield, and got a web page setup to control a little LED.&#160; But I got the cheaper enc28j60 based EtherShield.&#160; Not the newer, expensive one based on the Wiznet chip.&#160; The API calls for the Enc28j60 are a lot more difficult to understand than the newer ones.&#160; The difference in cost though is about 100%.&#160; You can get the Enc28j60 etherShield for about $20.&#160; The Wiznet one will be around $45.&#160; It will be interesting to see which one the book uses… I think we can both already guess <img src='http://www.gadgetnate.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p>Chapter 16 – Using, Modifying and Creating Libraries (maybe this is where I can learn how to create a easier to use library wrapper for the EtherShield that I have. )</p>
<p>Chapter 17 – Advanced Coding and Memory Handling</p>
<p>Chapter 18 – Using the Controller Chip Hardware – How to access and use hardware functions that are not “fully” exposed through the documented Arduino language… (Sounds interesting and advanced)</p>
<p>I have no idea how long it will take to get through the book.&#160; And I imagine we will be taking a lot of detours on the way to create projects using what we have learned.&#160; But I would recommend that if you are starting with the Arduino that you get the book and come along this journey with me.&#160; I intend to keep you updated on my progress in the book, and I intend to publish the code and projects that I create from the things that I learn from the book, but to fully understand everything, you will need the book.&#160; Please use this link:</p>
<p><iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=gadgetnate-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0596802471" frameborder="0" marginwidth="0" scrolling="no"></iframe> </p>
<p>Also, if you live in Harris county, then you can access it through the <a href="http://www.hcpl.net/">Harris Public County Library</a> who has an arrangement with <a href="http://proquest.safaribooksonline.com/">SafariBooksOnline</a> to make it available.&#160; Your library might have a similar setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/07/01/arduino-cookbook-by-michael-margolis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow Me Game &#8211; Arduino Based Game</title>
		<link>http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game</link>
		<comments>http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game#comments</comments>
		<pubDate>Fri, 01 Jul 2011 03:28:50 +0000</pubDate>
		<dc:creator>GadgetNate</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game</guid>
		<description><![CDATA[Remember playing MySimon (Simon Says) back in the 1980s?&#160; It was a simple game that could entertain you for hours.&#160; It had 4 buttons, each of a different color.&#160; Turn on the game, and one of the buttons would glow.&#160; Then you had to press that button.&#160; Another button was added to the pattern, and [...]]]></description>
			<content:encoded><![CDATA[<p>Remember playing MySimon (Simon Says) back in the 1980s?&#160; It was a simple game that could entertain you for hours.&#160; It had 4 buttons, each of a different color.&#160; Turn on the game, and one of the buttons would glow.&#160; Then you had to press that button.&#160; Another button was added to the pattern, and the goal was to get to the longest pattern without messing up.    <br />Here I show a simple Arduino based version of this game.&#160; It is simpler because there are only 3 buttons, but it is completely open for you to build on and learn from.</p>
<p><iframe height="349" src="http://www.youtube.com/embed/pp-ppQKLhI8" frameborder="0" width="425" allowfullscreen="allowfullscreen"></iframe></p>
<p>&#160;</p>
<p><a href="http://www.gadgetnate.com/wp-content/uploads/images/FollowMeGameArduinoBasedGame_13C1B/image.png"><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://www.gadgetnate.com/wp-content/uploads/images/FollowMeGameArduinoBasedGame_13C1B/image_thumb.png" width="244" height="223" /></a> </p>
<p>See the circuit and files on <a href="http://fritzing.org/projects/followme-simple-arduino-based-game/">Fritzing.org</a></p>
<p>&#160;</p>
<p>Update:&#160; I received an email about a more sophisticated version of Simon.</p>
<p><a href="http://www.youtube.com/watch?v=H916bHqAtvY&amp;feature=email">     <br /><img src="http://i1.ytimg.com/vi/H916bHqAtvY/default.jpg" /></a></p>
<p><a href="http://www.youtube.com/watch?v=H916bHqAtvY&amp;feature=email">Arduino SimonGame</a></p>
<p>More infos at <a href="http://jadiema.blogspot.com/">http://jadiema.blogspot.com/</a>    <br />Arduino Simon Game: Version 3    <br />Initial Release from David M. Auld (19th October 2009): Version 1 &amp; 2    <br /><a href="http://www.dave-auld.net/index.php?option=com_content&amp;view=article&amp;id=96:arduino-project-simon-game&amp;catid=54:arduino-projects&amp;Itemid=107">http://www.dave-auld.net/index.php?option=com_content&amp;view=article&amp;id=96:arduino-project-simon-game&amp;catid=54:arduino-projects&amp;Itemid=107</a>    <br />Added some features by jadiema: Version 3:    <br />NEW: Added EEPROM storage for high score: level and name    <br />NEW: Multilangage selection    <br />You&#8217;ll find the code at: <a href="http://code.google.com/p/my-arduino-projects/downloads/detail?name=Arduino_SimonGame_EEPROM_LANGUE_V3_1.pde&amp;can=2&amp;q=#makechanges">http://code.google.com/p/my-arduino-projects/downloads/detail?name=Arduino_SimonGame_EEPROM_LANGUE_V3_1.pde&amp;can=2&amp;q=#makechanges</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gadgetnate.com/2011/06/30/follow-me-game-arduino-based-game/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

