Differences

This shows you the differences between two versions of the page.

Link to this comparison view

products:ardx:circ-02 [2012/03/14 04:58] (current)
Line 1: Line 1:
  
 +<html>
 +<div id="CIRC-head">
 +<div id="CIRC-100"><table height="100px" width="100px" valign="center"><tr><td><span class="headText"><center>CIRC<br>02</center></span></td></tr></table></div>
 +<div id="CIRC-465"><table height="100px" width="465px" valign="center"><tr><td><span class="subText"><center>.:8 LED Fun:.<br>.:Multiple LEDs:.</center></span></td></tr></table></div>
 +<div id="CIRC-100"><img src="http://www.ardx.org/src/circ/CIRC-02-square-100.jpg" width="100" height="100"></div>
 +</div>
 +<span class="familyName"><center>(ARDX)   .:Arduino Expermentation Kit:.   (ARDX)</center></span>
 +<div id="CIRC-whitespace"></div>
 +<div id="CIRC-body">
 +<div id="CIRC-whitespace"></div><br>
 +<div id="CIRC-whatweredoing">
 +<span class="titleText">What We're Doing</span><br>
 +<span class="regularText">We have caused one LED to blink, now it's time to up the stakes. Lets connect eight. We'll also have an opportunity to stretch the Arduino a bit by creating various lighting sequences. This circuit is also a nice setup to experiment with writing your own programs and getting a feel for how the Arduino works.<br><br>Along with controlling the LEDs we start looking into a few simple programming methods to keep your programs small. <br><br>for() loops - used when you want to run a piece of code several times.<br>arrays[] - used to make managing variables easier (it's a group of variables).<br></span>
 +</div><br>
 +<div id="CIRC-whitespace"></div><br>
 +<div id="CIRC-thecircuit">
 +<span class="titleText">The Circuit</span><br>
 +<div id="CIRC-thepartsSideSpacer">
 +</div>
 +        <div id="CIRC-theparts">
 +          <span class="smallTitleText">The Parts</span><br>
 +          <span class="regularText">
 +<table>
 +<tr>
 +<td>
 +<img src="http://www.oomlout.com/parts/CIRC-01-3dsheet-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +CIRC-02<br>Breadboard Sheet<br>x1
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/HEAD-02-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +2 Pin Header<br>x4
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/LED-05G-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +5mm Green LED<br>x8
 +</span>
 +</td>
 +<td>
 +
 +<img src="http://www.oomlout.com/parts/WIRE-01-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Wire
 +</span>
 +</td>
 +</tr>
 +
 +<tr>
 +<td>
 +<img src="http://www.oomlout.com/parts/RES-561-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +560 Ohm Resistor<br>Green-Blue-Brown<br>x8
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/BLANK.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/BLANK.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +
 +</span>
 +</td>
 +<td>
 +
 +<img src="http://www.oomlout.com/parts/BLANK.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +
 +</span>
 +</td>
 +</tr>
 +</table>
 +</span>
 +        </div><br>
 +        <div id="CIRC-whitespace"></div><br>
 +        <div id="CIRC-thepartsSideSpacer"></div>
 +          <div id="CIRC-circuitBox">
 +            <div id="CIRC-schematic"><center><span class="smallTitleText">Schematic</span><span class="smallTitleText"><img src="http://www.ardx.org/src/circ/ARDX-SC-02-150.png"></span></center></div>
 + <br>
 + <div id="CIRC-smallwhitespace">&nbsp;</div><br>
 +            <div id="CIRC-resources">
 + <center><span class="smallTitleText">Resources</span><br><span class="smallMediumDarkText"><b>.:download:.</b><br>breadboard layout sheet<br><b><a href="http://ardx.org/BBLS02">http://ardx.org/BBLS02</a></b><br><br><b>.:view:.</b><br>assembly video <b><br><a href="http://ardx.org/VIDE02">http://ardx.org/VIDE02</a></b></span></center>
 +            </div>
 +          </div>
 +        <div id="CIRC-circuitPicture">
 +          <center>
 +            <img src="http://www.ardx.org/src/circ/CIRC02-3dexploded-445.png" width="445">
 +          </center>
 +        </div>
 +      </div><br>
 +      <div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-thecode">
 +        <span class="titleText">Code</span> <span class="smallDarkText">(no need to type everything in just)</span><br>
 +        <span class="mediumDarkText">Download the Code from ( <a href="http://ardx.org/CODE02 ">http://ardx.org/CODE02 </a>)<br>(and then copy the text and paste it into an empty Arduino Sketch)</span><br>
 +        <span class="code">        <prew>/*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;<br>
 +&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;Arduino&nbsp;Experimentation&nbsp;Kit&nbsp;Example&nbsp;Code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
 +&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;CIRC&#45;02&nbsp;.:&nbsp;8&nbsp;LED&nbsp;Fun&nbsp;:.&nbsp;(Multiple&nbsp;LEDs)&nbsp;&nbsp;&nbsp;|<br>
 +&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;<br>
 +&nbsp;*&nbsp;&nbsp;<br>
 +&nbsp;*&nbsp;&nbsp;A&nbsp;few&nbsp;Simple&nbsp;LED&nbsp;animations<br>
 +&nbsp;*<br>
 +&nbsp;*&nbsp;For&nbsp;more&nbsp;information&nbsp;on&nbsp;this&nbsp;circuit&nbsp;http://tinyurl.com/d2hrud<br>
 +&nbsp;*<br>
 +&nbsp;*/<br>
 +&nbsp;<br>
 +//LED&nbsp;Pin&nbsp;Variables<br>
 +int&nbsp;ledPins[]&nbsp;=&nbsp;{2,3,4,5,6,7,8,9};&nbsp;//An&nbsp;array&nbsp;to&nbsp;hold&nbsp;the&nbsp;pin&nbsp;each&nbsp;LED&nbsp;is&nbsp;connected&nbsp;to<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//i.e.&nbsp;LED&nbsp;#0&nbsp;is&nbsp;connected&nbsp;to&nbsp;pin&nbsp;2,&nbsp;LED&nbsp;#1,&nbsp;3&nbsp;and&nbsp;so&nbsp;on<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//to&nbsp;address&nbsp;an&nbsp;array&nbsp;use&nbsp;ledPins[0]&nbsp;this&nbsp;would&nbsp;equal&nbsp;2<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//and&nbsp;ledPins[7]&nbsp;would&nbsp;equal&nbsp;9<br>
 +&nbsp;<br>
 +/*<br>
 +&nbsp;*&nbsp;setup()&nbsp;&#45;&nbsp;this&nbsp;function&nbsp;runs&nbsp;once&nbsp;when&nbsp;you&nbsp;turn&nbsp;your&nbsp;Arduino&nbsp;on<br>
 +&nbsp;*&nbsp;We&nbsp;the&nbsp;three&nbsp;control&nbsp;pins&nbsp;to&nbsp;outputs<br>
 +&nbsp;*/<br>
 +void&nbsp;setup()<br>
 +{<br>
 +&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;//Set&nbsp;each&nbsp;pin&nbsp;connected&nbsp;to&nbsp;an&nbsp;LED&nbsp;to&nbsp;output&nbsp;mode&nbsp;(pulling&nbsp;high&nbsp;(on)&nbsp;or&nbsp;low&nbsp;(off)<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;<&nbsp;8;&nbsp;i++){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//this&nbsp;is&nbsp;a&nbsp;loop&nbsp;and&nbsp;will&nbsp;repeat&nbsp;eight&nbsp;times<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pinMode(ledPins[i],OUTPUT);&nbsp;//we&nbsp;use&nbsp;this&nbsp;to&nbsp;set&nbsp;each&nbsp;LED&nbsp;pin&nbsp;to&nbsp;output<br>
 +&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//the&nbsp;code&nbsp;this&nbsp;replaces&nbsp;is&nbsp;below<br>
 +&nbsp;<br>
 +&nbsp;&nbsp;/*&nbsp;(commented&nbsp;code&nbsp;will&nbsp;not&nbsp;run)<br>
 +&nbsp;&nbsp;&nbsp;*&nbsp;these&nbsp;are&nbsp;the&nbsp;lines&nbsp;replaced&nbsp;by&nbsp;the&nbsp;for&nbsp;loop&nbsp;above&nbsp;they&nbsp;do&nbsp;exactly&nbsp;the<br>
 +&nbsp;&nbsp;&nbsp;*&nbsp;same&nbsp;thing&nbsp;the&nbsp;one&nbsp;above&nbsp;just&nbsp;uses&nbsp;less&nbsp;typing<br>
 +&nbsp;&nbsp;pinMode(ledPins[0],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[1],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[2],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[3],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[4],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[5],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[6],OUTPUT);<br>
 +&nbsp;&nbsp;pinMode(ledPins[7],OUTPUT);<br>
 +&nbsp;&nbsp;(end&nbsp;of&nbsp;commented&nbsp;code)*/<br>
 +}<br>
 +&nbsp;<br>
 +&nbsp;<br>
 +/*<br>
 +&nbsp;*&nbsp;loop()&nbsp;&#45;&nbsp;this&nbsp;function&nbsp;will&nbsp;start&nbsp;after&nbsp;setup&nbsp;finishes&nbsp;and&nbsp;then&nbsp;repeat<br>
 +&nbsp;*&nbsp;we&nbsp;call&nbsp;a&nbsp;function&nbsp;called&nbsp;oneAfterAnother().&nbsp;if&nbsp;you&nbsp;would&nbsp;like&nbsp;a&nbsp;different&nbsp;behaviour<br>
 +&nbsp;*&nbsp;uncomment&nbsp;(delete&nbsp;the&nbsp;two&nbsp;slashes)&nbsp;one&nbsp;of&nbsp;the&nbsp;other&nbsp;lines<br>
 +&nbsp;*/<br>
 +void&nbsp;loop()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;run&nbsp;over&nbsp;and&nbsp;over&nbsp;again<br>
 +{<br>
 +&nbsp;&nbsp;oneAfterAnotherNoLoop();&nbsp;&nbsp;&nbsp;//this&nbsp;will&nbsp;turn&nbsp;on&nbsp;each&nbsp;LED&nbsp;one&nbsp;by&nbsp;one&nbsp;then&nbsp;turn&nbsp;each&nbsp;off<br>
 +&nbsp;&nbsp;//oneAfterAnotherLoop();&nbsp;&nbsp;&nbsp;//does&nbsp;the&nbsp;same&nbsp;as&nbsp;oneAfterAnotherNoLoop&nbsp;but&nbsp;with&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//much&nbsp;less&nbsp;typing<br>
 +&nbsp;&nbsp;//oneOnAtATime();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//this&nbsp;will&nbsp;turn&nbsp;one&nbsp;LED&nbsp;on&nbsp;then&nbsp;turn&nbsp;the&nbsp;next&nbsp;one<br>
 +&nb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sp;again<br>
 +}<br>
 +&nbsp;<br>
 +/*<br>
 +&nbsp;*&nbsp;oneAfterAnotherNoLoop()&nbsp;&#45;&nbsp;Will&nbsp;light&nbsp;one&nbsp;LED&nbsp;then&nbsp;delay&nbsp;for&nbsp;delayTime&nbsp;then&nbsp;light<br>
 +&nbsp;*&nbsp;the&nbsp;next&nbsp;LED&nbsp;until&nbsp;all&nbsp;LEDs&nbsp;are&nbsp;on&nbsp;it&nbsp;will&nbsp;then&nbsp;turn&nbsp;them&nbsp;off&nbsp;one&nbsp;after&nbsp;another<br>
 +&nbsp;*<br>
 +&nbsp;*&nbsp;this&nbsp;does&nbsp;it&nbsp;without&nbsp;using&nbsp;a&nbsp;loop&nbsp;which&nbsp;makes&nbsp;for&nbsp;a&nbsp;lot&nbsp;of&nbsp;typing.&nbsp;<br>
 +&nbsp;*&nbsp;oneOnAtATimeLoop()&nbsp;does&nbsp;exactly&nbsp;the&nbsp;same&nbsp;thing&nbsp;with&nbsp;less&nbsp;typing<br>
 +&nbsp;*/<br>
 +void&nbsp;oneAfterAnotherNoLoop(){<br>
 +&nbsp;&nbsp;int&nbsp;delayTime&nbsp;=&nbsp;100;&nbsp;//the&nbsp;time&nbsp;(in&nbsp;milliseconds)&nbsp;to&nbsp;pause&nbsp;between&nbsp;LEDs<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make&nbsp;smaller&nbsp;for&nbsp;quicker&nbsp;switching&nbsp;and&nbsp;larger&nbsp;for&nbsp;slower<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[0],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#0&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;2&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[1],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#1&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;3&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[2],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#2&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;4&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[3],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#3&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;5&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[4],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#4&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;6&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[5],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#5&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;7&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[6],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#6&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;8&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[7],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#7&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;9&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds&nbsp;&nbsp;<br>
 +&nbsp;<br>
 +//Turns&nbsp;Each&nbsp;LED&nbsp;Off<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[7],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#0&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;2&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[6],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#1&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;3&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[5],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#2&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;4&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[4],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#3&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;5&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[3],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#4&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;6&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[2],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#5&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;7&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[1],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#6&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;8&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds<br>
 +&nbsp;&nbsp;digitalWrite(ledPins[0],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#7&nbsp;(connected&nbsp;to&nbsp;pin&nbsp;9&nbsp;)<br>
 +&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//waits&nbsp;delayTime&nbsp;milliseconds&nbsp;&nbsp;<br>
 +}<br>
 +&nbsp;<br>
 +/*<br>
 +&nbsp;*&nbsp;oneAfterAnotherLoop()&nbsp;&#45;&nbsp;Will&nbsp;light&nbsp;one&nbsp;LED&nbsp;then&nbsp;delay&nbsp;for&nbsp;delayTime&nbsp;then&nbsp;light<br>
 +&nbsp;*&nbsp;the&nbsp;next&nbsp;LED&nbsp;until&nbsp;all&nbsp;LEDs&nbsp;are&nbsp;on&nbsp;it&nbsp;will&nbsp;then&nbsp;turn&nbsp;them&nbsp;off&nbsp;one&nbsp;after&nbsp;another<br>
 +&nbsp;*<br>
 +&nbsp;*&nbsp;this&nbsp;does&nbsp;it&nbsp;using&nbsp;a&nbsp;loop&nbsp;which&nbsp;makes&nbsp;for&nbsp;a&nbsp;lot&nbsp;less&nbsp;typing.&nbsp;<br>
 +&nbsp;*&nbsp;than&nbsp;oneOnAtATimeNoLoop()&nbsp;does&nbsp;exactly&nbsp;the&nbsp;same&nbsp;thing&nbsp;with&nbsp;less&nbsp;typing<br>
 +&nbsp;*/<br>
 +void&nbsp;oneAfterAnotherLoop(){<br>
 +&nbsp;&nbsp;int&nbsp;delayTime&nbsp;=&nbsp;100;&nbsp;//the&nbsp;time&nbsp;(in&nbsp;milliseconds)&nbsp;to&nbsp;pause&nbsp;between&nbsp;LEDs<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make&nbsp;smaller&nbsp;for&nbsp;quicker&nbsp;switching&nbsp;and&nbsp;larger&nbsp;for&nbsp;slower<br>
 +&nbsp;<br>
 +//Turn&nbsp;Each&nbsp;LED&nbsp;on&nbsp;one&nbsp;after&nbsp;another<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;<=&nbsp;7;&nbsp;i++){<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[i],&nbsp;HIGH);&nbsp;&nbsp;//Turns&nbsp;on&nbsp;LED&nbsp;#i&nbsp;each&nbsp;time&nbsp;this&nbsp;runs&nbsp;i<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//gets&nbsp;one&nbsp;added&nbsp;to&nbsp;it&nbsp;so&nbsp;this&nbsp;will&nbsp;repeat&nbsp;<br>
 +&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//8&nbsp;times&nbsp;the&nbsp;first&nbsp;time&nbsp;i&nbsp;will&nbsp;=&nbsp;0&nbsp;the&nbsp;final<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//time&nbsp;i&nbsp;will&nbsp;equal&nbsp;7;<br>
 +&nbsp;<br>
 +//Turn&nbsp;Each&nbsp;LED&nbsp;off&nbsp;one&nbsp;after&nbsp;another<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;7;&nbsp;i&nbsp;>=&nbsp;0;&nbsp;i&#45;&#45;){&nbsp;&nbsp;//same&nbsp;as&nbsp;above&nbsp;but&nbsp;rather&nbsp;than&nbsp;starting&nbsp;at&nbsp;0&nbsp;and&nbsp;counting&nbsp;u<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//p<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//we&nbsp;start&nbsp;at&nbsp;seven&nbsp;and&nbsp;count&nbsp;down<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[i],&nbsp;LOW);&nbsp;&nbsp;//Turns&nbsp;off&nbsp;LED&nbsp;#i&nbsp;each&nbsp;time&nbsp;this&nbsp;runs&nbsp;i<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;delay(delayTime);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//gets&nbsp;one&nbsp;subtracted&nbsp;from&nbsp;it&nbsp;so&nbsp;this&nbsp;will&nbsp;repeat&nbsp;<br>
 +&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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>
 +void&nbsp;oneOnAtATime(){<br>
 +&nbsp;&nbsp;int&nbsp;delayTime&nbsp;=&nbsp;100;&nbsp;//the&nbsp;time&nbsp;(in&nbsp;milliseconds)&nbsp;to&nbsp;pause&nbsp;between&nbsp;LEDs<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make&nbsp;smaller&nbsp;for&nbsp;quicker&nbsp;switching&nbsp;and&nbsp;larger&nbsp;for&nbsp;slower<br>
 +&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;<=&nbsp;7;&nbsp;i++){<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED&nbsp;=&nbsp;i&nbsp;&#45;&nbsp;1;&nbsp;&nbsp;//Calculate&nbsp;which&nbsp;LED&nbsp;was&nbsp;turned&nbsp;on&nbsp;last&nbsp;time&nbsp;through<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;if(i&nbsp;==&nbsp;0)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//for&nbsp;i&nbsp;=&nbsp;1&nbsp;to&nbsp;7&nbsp;this&nbsp;is&nbsp;i&nbsp;minus&nbsp;1&nbsp;(i.e.&nbsp;if&nbsp;i&nbsp;=&nbsp;2&nbsp;we&nbsp;will<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offLED&nbsp;=&nbsp;7;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//turn&nbsp;on&nbsp;LED&nbsp;2&nbsp;and&nbsp;off&nbsp;LED&nbsp;1)<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//however&nbsp;if&nbsp;i&nbsp;=&nbsp;0&nbsp;we&nbsp;don't&nbsp;want&nbsp;to&nbsp;turn&nbsp;of&nbsp;led&nbsp;&#45;1&nbsp;(doesn't&nbsp;exist)<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//instead&nbsp;we&nbsp;turn&nbsp;off&nbsp;LED&nbsp;7,&nbsp;(looping&nbsp;around)<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[i],&nbsp;HIGH);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//turn&nbsp;on&nbsp;LED&nbsp;#i<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[offLED],&nbsp;LOW);&nbsp;//turn&nbsp;off&nbsp;the&nbsp;LED&nbsp;we&nbsp;turned&nbsp;on&nbsp;last&nbsp;time<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;delay(delayTime);<br>
 +&nbsp;&nbsp;}<br>
 +}<br>
 +&nbsp;<br>
 +/*<br>
 +&nbsp;*&nbsp;inAndOut()&nbsp;&#45;&nbsp;This&nbsp;will&nbsp;turn&nbsp;on&nbsp;the&nbsp;two&nbsp;middle&nbsp;LEDs&nbsp;then&nbsp;the&nbsp;next&nbsp;two&nbsp;out<br>
 +&nbsp;*&nbsp;making&nbsp;an&nbsp;in&nbsp;and&nbsp;out&nbsp;look<br>
 +&nbsp;*/<br>
 +void&nbsp;inAndOut(){<br>
 +&nbsp;&nbsp;int&nbsp;delayTime&nbsp;=&nbsp;100;&nbsp;//the&nbsp;time&nbsp;(in&nbsp;milliseconds)&nbsp;to&nbsp;pause&nbsp;between&nbsp;LEDs<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make&nbsp;smaller&nbsp;for&nbsp;quicker&nbsp;switching&nbsp;and&nbsp;larger&nbsp;for&nbsp;slower<br>
 +&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;//runs&nbsp;the&nbsp;LEDs&nbsp;out&nbsp;from&nbsp;the&nbsp;middle<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;<=&nbsp;3;&nbsp;i++){<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED&nbsp;=&nbsp;i&nbsp;&#45;&nbsp;1;&nbsp;&nbsp;//Calculate&nbsp;which&nbsp;LED&nbsp;was&nbsp;turned&nbsp;on&nbsp;last&nbsp;time&nbsp;through<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;if(i&nbsp;==&nbsp;0)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//for&nbsp;i&nbsp;=&nbsp;1&nbsp;to&nbsp;7&nbsp;this&nbsp;is&nbsp;i&nbsp;minus&nbsp;1&nbsp;(i.e.&nbsp;if&nbsp;i&nbsp;=&nbsp;2&nbsp;we&nbsp;will<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offLED&nbsp;=&nbsp;3;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//turn&nbsp;on&nbsp;LED&nbsp;2&nbsp;and&nbsp;off&nbsp;LED&nbsp;1)<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbs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&nbsp;&nbsp;int&nbsp;onLED2&nbsp;=&nbsp;4&nbsp;+&nbsp;i;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//this&nbsp;is&nbsp;the&nbsp;first&nbsp;LED&nbsp;to&nbsp;go&nbsp;on&nbsp;ie.&nbsp;LED&nbsp;#4&nbsp;when&nbsp;i&nbsp;=&nbsp;0&nbsp;and&nbsp;LED<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//#7&nbsp;when&nbsp;i&nbsp;=&nbsp;3&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED1&nbsp;=&nbsp;3&nbsp;&#45;&nbsp;offLED;&nbsp;//turns&nbsp;off&nbsp;the&nbsp;LED&nbsp;we&nbsp;turned&nbsp;on&nbsp;last&nbsp;time<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED2&nbsp;=&nbsp;4&nbsp;+&nbsp;offLED;&nbsp;//turns&nbsp;off&nbsp;the&nbsp;LED&nbsp;we&nbsp;turned&nbsp;on&nbsp;last&nbsp;time<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[onLED1],&nbsp;HIGH);<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[onLED2],&nbsp;HIGH);&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[offLED1],&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[offLED2],&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;delay(delayTime);<br>
 +&nbsp;&nbsp;}<br>
 +&nbsp;<br>
 +&nbsp;&nbsp;//runs&nbsp;the&nbsp;LEDs&nbsp;into&nbsp;the&nbsp;middle<br>
 +&nbsp;&nbsp;for(int&nbsp;i&nbsp;=&nbsp;3;&nbsp;i&nbsp;>=&nbsp;0;&nbsp;i&#45;&#45;){<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED&nbsp;=&nbsp;i&nbsp;+&nbsp;1;&nbsp;&nbsp;//Calculate&nbsp;which&nbsp;LED&nbsp;was&nbsp;turned&nbsp;on&nbsp;last&nbsp;time&nbsp;through<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;if(i&nbsp;==&nbsp;3)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//for&nbsp;i&nbsp;=&nbsp;1&nbsp;to&nbsp;7&nbsp;this&nbsp;is&nbsp;i&nbsp;minus&nbsp;1&nbsp;(i.e.&nbsp;if&nbsp;i&nbsp;=&nbsp;2&nbsp;we&nbsp;will<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offLED&nbsp;=&nbsp;0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//turn&nbsp;on&nbsp;LED&nbsp;2&nbsp;and&nbsp;off&nbsp;LED&nbsp;1)<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;i;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//this&nbsp;is&nbsp;the&nbsp;first&nbsp;LED&nbsp;to&nbsp;go&nbsp;on&nbsp;ie.&nbsp;LED&nbsp;#4&nbsp;when&nbsp;i&nbsp;=&nbsp;0&nbsp;and&nbsp;LED<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//#7&nbsp;when&nbsp;i&nbsp;=&nbsp;3&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED1&nbsp;=&nbsp;3&nbsp;&#45;&nbsp;offLED;&nbsp;//turns&nbsp;off&nbsp;the&nbsp;LED&nbsp;we&nbsp;turned&nbsp;on&nbsp;last&nbsp;time<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;offLED2&nbsp;=&nbsp;4&nbsp;+&nbsp;offLED;&nbsp;//turns&nbsp;off&nbsp;the&nbsp;LED&nbsp;we&nbsp;turned&nbsp;on&nbsp;last&nbsp;time<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[onLED1],&nbsp;HIGH);<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[onLED2],&nbsp;HIGH);&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[offLED1],&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;digitalWrite(ledPins[offLED2],&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;&nbsp;&nbsp;delay(delayTime);<br>
 +&nbsp;&nbsp;}<br>
 +}<br>
 +<br>
 +        </prew></span>
 +      </div>
 +      <div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-notWorking">
 +        <span class="titleText">Not Working?</span> <span class="smallDarkText">(3 things to try)</span>
 + <br><div id="CIRC-smallwhitespace">&nbsp;</div><br>
 + <div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw1"><center><span class="regularText"><b>Some LEDs Fail to Light </b></span><br><span class="regularText">It is easy to insert an LED backwards. Check the LEDs that aren't working and ensure they the right way around.</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw2"><center><span class="regularText"><b>Operating out of sequence  </b></span><br><span class="regularText">With eight wires it's easy to cross a couple. Double check that the first LED is plugged into pin 2 and each pin there after.</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw3"><center><span class="regularText"><b>Starting Afresh</b></span><br><span class="regularText">Its easy to accidentally misplace a wire without noticing. Pulling everything out and starting with a fresh slate is often easier than trying to track down the problem.</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +</div></div>
 +<div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-makingBetter">
 +<span class="titleText">Making it Better?</span><br>&nbsp;<br>
 +<span class="regularText"><b>Switching to Loops:</b> <BR>in the <span class="bigCode">loop()</span> function there are 4 lines. The last three all start with a '//' this means the line is treated as a comment (not run). To switch the program to use loops change the <span class="bigCode">void loop()</span> code to: <BR> <span class="bigCode">  <BR>  //oneAfterAnotherNoLoop();    <BR>  oneAfterAnotherLoop();    <BR>  //oneOnAtATime();           <BR>  //inAndOut(); <BR> </span> <BR>Upload the program, and notice that nothing has changed. You can take a look at the two functions, each does the same thing, but use  different approaches (hint the second one uses a for loop) <BR>&nbsp;<br> <BR><b>Extra Animations:</b> <BR>Tired of this animation? Then try the other two sample animations. Uncomment their lines and upload the program to your board and enjoy the new light animations. (delete the slashes in front of row 3 and then 4) <BR>&nbsp;<br> <BR><b>Testing out your own Animations:</b> <BR>Jump into the included code and start changing things. The main point is to turn an LED on use: <BR>&nbsp;&nbsp;<span class="bigCode">digitalWrite(pinNumber, HIGH);</span>  <BR>Then to turn it off use; <BR> &nbsp;&nbsp;<span class="bigCode">digitalWrite(pinNumber, LOW);</span> <BR> Type away, regardless of what you change you won't break anything. <BR>
 +</span></html>