<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0QMQHo4eCp7ImA9WhRaE0o.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675</id><updated>2012-02-16T07:56:21.430+01:00</updated><title>Circuits for beginners</title><subtitle type="html">A blog about my adventures while learning electronics</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://circuitsforbeginners.blogspot.com/" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/CircuitsForBeginners" /><feedburner:info uri="circuitsforbeginners" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkMNQHw7cCp7ImA9WxFQEUo.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3165582758616485070</id><published>2010-05-06T20:28:00.000+02:00</published><updated>2010-05-06T20:28:11.208+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-06T20:28:11.208+02:00</app:edited><title>Update for AdvBut</title><content type="html">Today I released a new version of AdvBut. The adanced button library for the Arduino platform.&lt;br /&gt;
&lt;br /&gt;
New features:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Debouncing detection &lt;/li&gt;
&lt;li&gt;Button repeat improved &lt;/li&gt;
&lt;li&gt;New parameter in constructor, allowing the use of analog  buttons &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Get it while it's fresh from http://www.arduino.cc/playground/Code/AdvButton&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3165582758616485070?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AQXdsMTEjaNHzKQWZl8BcBQ0slw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQXdsMTEjaNHzKQWZl8BcBQ0slw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AQXdsMTEjaNHzKQWZl8BcBQ0slw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQXdsMTEjaNHzKQWZl8BcBQ0slw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/4Kbilnf3DlY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3165582758616485070/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2010/05/update-for-advbut.html#comment-form" title="33 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3165582758616485070?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3165582758616485070?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/4Kbilnf3DlY/update-for-advbut.html" title="Update for AdvBut" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>33</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2010/05/update-for-advbut.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcER305cSp7ImA9WxFSFkw.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-6637247422597064880</id><published>2010-04-14T19:43:00.001+02:00</published><updated>2010-04-18T20:40:06.329+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-18T20:40:06.329+02:00</app:edited><title>Electronic component: MAX756</title><content type="html">I Wondered if it is possible to run an Arduino on 1 battery. Obviously, there are problems. The Atmega won't run on anything lower than 3.3v. As one battery gives 1.5v, we are a bit short on volts.&lt;br /&gt;
&lt;br /&gt;
Luckily, there is the MAX756. This IC has the possibility to increase the voltage. Of course this has a disadvantage, the amount of Ampere will decrease. So, you are (more) limited on how much you can power.&lt;br /&gt;
&lt;br /&gt;
The following circuit will accept anything between 0.7 an 5v, so you can also use 2 batteries if you want. The output is 5v, more than enough to power you arduino.&lt;br /&gt;
&lt;br /&gt;
You will need the following components:&lt;br /&gt;
1 x MAX756&lt;br /&gt;
1 x  22 uH axial RF choke&lt;br /&gt;
1 x 1N5817 Schottky diode&lt;br /&gt;
2 x 1 uF Electrolytic Capacitator &lt;br /&gt;
2 x 100 uF Electrolytic Capacitator&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/S8X8mxuPLhI/AAAAAAAAAcY/u3PovrVhm7Y/s1600/circuit_1v5_to_5v.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/S8X8mxuPLhI/AAAAAAAAAcY/u3PovrVhm7Y/s320/circuit_1v5_to_5v.png" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;The MAX756 is quite expensive in low quantities, I bought one for 5€. If you find them cheaper, please let me know.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/S8tMyqxavzI/AAAAAAAAAcg/uAM02ooplH0/s1600/IMG_0006.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/S8tMyqxavzI/AAAAAAAAAcg/uAM02ooplH0/s320/IMG_0006.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-6637247422597064880?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UWGYD9WhM50yVqlpMhWYrhzS1z4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UWGYD9WhM50yVqlpMhWYrhzS1z4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UWGYD9WhM50yVqlpMhWYrhzS1z4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UWGYD9WhM50yVqlpMhWYrhzS1z4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/CsZ547ew2sU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/6637247422597064880/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2010/04/electronic-component-max756.html#comment-form" title="3 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/6637247422597064880?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/6637247422597064880?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/CsZ547ew2sU/electronic-component-max756.html" title="Electronic component: MAX756" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_t8-2yspE-3E/S8X8mxuPLhI/AAAAAAAAAcY/u3PovrVhm7Y/s72-c/circuit_1v5_to_5v.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2010/04/electronic-component-max756.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYDQncyfCp7ImA9WxBXE04.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-5710863129751924589</id><published>2010-01-24T12:21:00.002+01:00</published><updated>2010-01-24T12:22:53.994+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-24T12:22:53.994+01:00</app:edited><title>AdvButton, a button library for the Arduino platform</title><content type="html">&lt;h1 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small; font-weight: normal;"&gt;I've decided to create a library for using buttons on the Arduino platform. See also http://www.arduino.cc/playground/Code/AdvButton.&lt;/span&gt;&lt;br /&gt;
&lt;/h1&gt;&lt;h1 style="font-family: Arial,Helvetica,sans-serif;"&gt;Features&lt;/h1&gt;&lt;ol&gt;&lt;li&gt;Event based implementation &lt;/li&gt;
&lt;li&gt;Recording the time a button is pressed &lt;/li&gt;
&lt;li&gt;Adjustable repeat delay, start delay for the keypressed event &lt;/li&gt;
&lt;li&gt;requires only a single call in the main loop &lt;/li&gt;
&lt;/ol&gt;&lt;h1&gt;Download, install and import&lt;/h1&gt;Download here: &lt;a class="urllink" href="http://www.arduino.cc/playground/uploads/Code/AdvButton.zip" rel="nofollow"&gt;Attach:AdvButton.zip&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Extract the folder AdvButton under &lt;arduino home=""&gt;/hardware/libraries/. (Re)start the Arduino application and select from the menu bar: "Sketch-&amp;gt;Import Library-&amp;gt;AdvButton". The following lines should be added:&amp;nbsp;&lt;/arduino&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;#include &lt;advbutton.h&gt;&lt;advbutton.h&gt;&amp;lt; AdvButton.h &amp;gt;&lt;/advbutton.h&gt;&lt;/advbutton.h&gt;&lt;/pre&gt;&lt;pre&gt;&lt;advbutton.h&gt;#include &amp;lt; ButtonManager.h &amp;gt;&lt;buttonmanager.h&gt;&lt;buttonmanager.h&gt;&lt;/buttonmanager.h&gt;&lt;/buttonmanager.h&gt;&lt;/advbutton.h&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;See the file buttondemo.pde, included in the zip, for an example. &lt;br /&gt;
&lt;h1&gt;Usage&lt;/h1&gt;After importing the header files, declare the buttons:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;#define PINBUTTON1 2
#define PINBUTTON2 3

#define PINLIGHT1 8
#define PINLIGHT2 9

AdvButton but1 = AdvButton(PINBUTTON1,OnKeyPressBut1,100,1000);
AdvButton but2 = AdvButton(PINBUTTON2,NULL,OnKeyDownBut2,OnKeyUpBut2);&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;Button 1 will generate a keypress event upon pressing the button at pin 2. After a short delay (1000 milliseconds), every 100 milliseconds the keypress event is raise again. Until the button is released. &lt;br /&gt;
Button 2 will generate a keydown event upon pressing the button at pin 3. After releasing the button a keyup event is raised. &lt;br /&gt;
Next we need to define the event functions. The triggering button is passed as parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;void OnKeyPressBut1(AdvButton* but)
{
  digitalWrite(PINLIGHT1,HIGH);
  delay(5);
  digitalWrite(PINLIGHT1,LOW);
}


void OnKeyDownBut2(AdvButton* but)
{
  digitalWrite(PINLIGHT2,HIGH);

}

void OnKeyUpBut2(AdvButton* but)
{
  digitalWrite(PINLIGHT2,LOW);
}&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;Last is the adding a call to the buttonmanager to update the button states:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;void loop()
{
  ButtonManager::instance()-&amp;gt;checkButtons();
}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-5710863129751924589?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dnXmODklzsIhLLJhmbyY_v7Op-s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dnXmODklzsIhLLJhmbyY_v7Op-s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dnXmODklzsIhLLJhmbyY_v7Op-s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dnXmODklzsIhLLJhmbyY_v7Op-s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/Rm0U4CBVpq0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/5710863129751924589/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2010/01/advbutton-button-library-for-arduino.html#comment-form" title="3 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5710863129751924589?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5710863129751924589?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/Rm0U4CBVpq0/advbutton-button-library-for-arduino.html" title="AdvButton, a button library for the Arduino platform" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2010/01/advbutton-button-library-for-arduino.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4ASXY6fyp7ImA9WxBXEEw.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3374290144703515608</id><published>2010-01-20T19:59:00.000+01:00</published><updated>2010-01-20T19:59:08.817+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-20T19:59:08.817+01:00</app:edited><title>Arduino: Controlling a DC motor</title><content type="html">It's been a while, but I've been busy with an interesting project. I will blog about it later on. Totally unrelated is today's topic: controlling an DC motor with an Arduino. At first you might say that it is easy to power an DC motor with an Arduino. Put it on a digital pin and enable or disable the motor. But if we want different speeds you will need a different voltage. As a digital pin is only high (5v) or low (0v), the motor can either go very fast or stop. How do we fix this problem?&lt;br /&gt;
&lt;br /&gt;
The short answer is quite simple actually: use pulses. By sending a pulse every x milliseconds the motor will rotate faster or slower depending on the pulse length. The longer answer, however, is a bit harder. We will need something to flat out the pulses a bit. As the pulse top is 5v and the pulse bottom is 0v, the engine will actually be turned off and on very fast. By using an capacitator we can flat out the pulse to, for example, top 3v and bottom 2.5v. &lt;br /&gt;
&lt;br /&gt;
To build the following circuit we will need:&lt;br /&gt;
1 x An Arduino board&lt;br /&gt;
1 x C547B transistor&lt;br /&gt;
2 x 10KOhm resistors&lt;br /&gt;
1 x 5v DC Motor&lt;br /&gt;
1 x 100 MicroF Elco&lt;br /&gt;
2 x push-to-make buttons&lt;br /&gt;
&lt;br /&gt;
This circuit will send a pulse every x milliseconds. You can control the pulse length by pressing the buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/S1dRV6FTLxI/AAAAAAAAAbs/rrJnbPwtTZI/s1600-h/circuit_arduino_motor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/S1dRV6FTLxI/AAAAAAAAAbs/rrJnbPwtTZI/s320/circuit_arduino_motor.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Upload the following sketch to the Arduino, you will need the &lt;a href="http://www.arduino.cc/playground/Code/Metro"&gt;Metro library&lt;/a&gt;:&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;#include &lt;metro.h&gt;&lt;br /&gt;
&lt;br /&gt;
#define PINBUTTON1 2&lt;br /&gt;
#define PINBUTTON2 3&lt;br /&gt;
#define PINMOTOR 8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
signed int pulseTime=50;&lt;br /&gt;
unsigned long prevPulse = millis();&lt;br /&gt;
&lt;br /&gt;
boolean inPulse = false;&lt;br /&gt;
&lt;br /&gt;
Metro MotorPulse = Metro(250); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void setup ()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; pinMode(PINMOTOR, OUTPUT);&lt;br /&gt;
&amp;nbsp; Serial.begin(9600);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; if (millis() %500 ==0)&lt;br /&gt;
&amp;nbsp;{ &lt;br /&gt;
&amp;nbsp; int curbut1 = digitalRead(PINBUTTON1);&lt;br /&gt;
&amp;nbsp; if (curbut1==HIGH)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pulseTime + 5 &amp;lt;=100)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; pulseTime +=5; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pulseTime=100;&lt;br /&gt;
&amp;nbsp;Serial.print(pulseTime);&lt;br /&gt;
&amp;nbsp;Serial.print("\n");&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; int curbut2 = digitalRead(PINBUTTON2);&lt;br /&gt;
&amp;nbsp; if ( (curbut2==HIGH))&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pulseTime - 5 &amp;gt;=0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pulseTime -=5; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pulseTime = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;Serial.print(pulseTime);&lt;br /&gt;
&amp;nbsp;Serial.print("\n");&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; if (!inPulse)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MotorPulse.check() == 1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MotorPulse.interval(5);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inPulse = true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(PINMOTOR , HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MotorPulse.check() == 1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MotorPulse.interval(pulseTime);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inPulse = false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(PINMOTOR , LOW);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;/metro.h&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/S1dRq1d2W3I/AAAAAAAAAb0/srklG2Evqc8/s1600-h/IMG_9647.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/S1dRq1d2W3I/AAAAAAAAAb0/srklG2Evqc8/s320/IMG_9647.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3374290144703515608?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tCD6bWmUgG8D6IeOtI9pQyZZRM8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tCD6bWmUgG8D6IeOtI9pQyZZRM8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tCD6bWmUgG8D6IeOtI9pQyZZRM8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tCD6bWmUgG8D6IeOtI9pQyZZRM8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/R1GX_l1hZvw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3374290144703515608/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2010/01/arduino-controlling-dc-motor.html#comment-form" title="1 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3374290144703515608?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3374290144703515608?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/R1GX_l1hZvw/arduino-controlling-dc-motor.html" title="Arduino: Controlling a DC motor" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/S1dRV6FTLxI/AAAAAAAAAbs/rrJnbPwtTZI/s72-c/circuit_arduino_motor.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2010/01/arduino-controlling-dc-motor.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIMQX0-fip7ImA9WxNaE0s.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-5305319935643798791</id><published>2009-11-28T00:13:00.000+01:00</published><updated>2009-11-28T00:13:00.356+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-28T00:13:00.356+01:00</app:edited><title>Project: Rolling the dice, putting it together</title><content type="html">In the previous posts I have talked about building a die, expanding the I/O pins on the Arduino and reading input from a player. Today we are going to build the complete game.&lt;br /&gt;
&lt;br /&gt;
The following circuit is cut in parts. The first circuit&amp;nbsp; is the overview, the second is one die. Therefore you will need to build the second circuit twice. I've put in transistors, because the PCF8574P will not deliver much current.&amp;nbsp; The following components are required to build the game:&lt;br /&gt;
&lt;br /&gt;
1 x Arduino Duemilanove&lt;br /&gt;
15 x Red LED (7 for each die, 1 for player two)&lt;br /&gt;
1 x green LED (player one)&lt;br /&gt;
2 x PCF8574P (one for each die)&lt;br /&gt;
2 x 1.5 KOhm resistor (brown, green, red, gold) You can use up to 2 KOhm. I put 1 KOhm + 680 Ohm in series instead.&lt;br /&gt;
16 x 680 Ohm resistor (blue, gray, brown, gold)&lt;br /&gt;
&lt;br /&gt;
2 x 10 KOhm resistor (brown, black, orange, gold)&lt;br /&gt;
14 x transistor (C547B)&lt;br /&gt;
2 x press-to-connect buttons &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SwknnkKZVwI/AAAAAAAAAak/v3KZUCuxloo/s1600/circuit_dice_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SwknnkKZVwI/AAAAAAAAAak/v3KZUCuxloo/s320/circuit_dice_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SwknLQhn3OI/AAAAAAAAAac/SS5ppYzWvDw/s1600/circuit_dice_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SwknLQhn3OI/AAAAAAAAAac/SS5ppYzWvDw/s320/circuit_dice_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;/* define addresses of the dice */&lt;br /&gt;
#define DICE_1 (0x4 &amp;lt;&amp;lt; 3 | 0x0) // 0100000&lt;br /&gt;
#define DICE_2 (0x4 &amp;lt;&amp;lt; 3 | 0x1) // 0100001&lt;br /&gt;
&lt;br /&gt;
/* include wire */&lt;br /&gt;
#include &lt;wire.h&gt; &lt;br /&gt;
&lt;br /&gt;
/* define pin output for player lights and buttons */&lt;br /&gt;
int light1 = 9;&lt;br /&gt;
int light2 = 10;&lt;br /&gt;
int button1 = 11;&lt;br /&gt;
int button2 = 12;&lt;br /&gt;
&lt;br /&gt;
/* define gamemodes */&lt;br /&gt;
int gamestart = 0;&lt;br /&gt;
int gamePlayer1 =1;&lt;br /&gt;
int gamePlayer2 = 2;&lt;br /&gt;
int rollingPlayer1 = 3;&lt;br /&gt;
int rollingPlayer2 = 4;&lt;br /&gt;
int gameEnd = 5;&lt;br /&gt;
int gameMode = gamestart;&lt;br /&gt;
&lt;br /&gt;
/* current number for each die*/&lt;br /&gt;
int curNum[2];&lt;br /&gt;
&lt;br /&gt;
/* results for each throw */&lt;br /&gt;
int result1[2];&lt;br /&gt;
int result2[2];&lt;br /&gt;
&lt;br /&gt;
int tick=0;&lt;br /&gt;
int tmp=0;&lt;br /&gt;
bool tmpBool;&lt;br /&gt;
int input;&lt;br /&gt;
&lt;br /&gt;
/* different dicemodes */&lt;br /&gt;
byte dicemode[8] =&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; B0000000,&lt;br /&gt;
&amp;nbsp; B0001000,&lt;br /&gt;
&amp;nbsp; B1000001,&lt;br /&gt;
&amp;nbsp; B1001001,&lt;br /&gt;
&amp;nbsp; B1010101,&lt;br /&gt;
&amp;nbsp; B1011101,&lt;br /&gt;
&amp;nbsp; B1110111,&lt;br /&gt;
&amp;nbsp; B1111111&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
byte curmode_d1;&lt;br /&gt;
byte curmode_d2;&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* start the I2c */&lt;br /&gt;
&amp;nbsp; Wire.begin();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; /* set pins */&lt;br /&gt;
&amp;nbsp; pinMode(light1, OUTPUT); &lt;br /&gt;
&amp;nbsp; pinMode(light2, OUTPUT); &lt;br /&gt;
&amp;nbsp; pinMode(button1, INPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; pinMode(button2, INPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* reset dice */&lt;br /&gt;
&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp; setDiceMode(DICE_2,0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void setDiceMode(byte dice, int num)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* copy a dice mode into the current mode for a dice */&lt;br /&gt;
&amp;nbsp; if (dice == DICE_1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(&amp;amp;curmode_d1,&amp;amp;dicemode[num],sizeof(curmode_d1));&lt;br /&gt;
&amp;nbsp; else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(&amp;amp;curmode_d2,&amp;amp;dicemode[num],sizeof(curmode_d2));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void showDice()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* show die one by sending the current mode */&lt;br /&gt;
&amp;nbsp; Wire.beginTransmission(DICE_1);&lt;br /&gt;
&amp;nbsp; Wire.send(curmode_d1);&lt;br /&gt;
&amp;nbsp; Wire.endTransmission(); &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* show die two by sending the current mode */&lt;br /&gt;
&amp;nbsp; Wire.beginTransmission(DICE_2);&lt;br /&gt;
&amp;nbsp; Wire.send(curmode_d2);&lt;br /&gt;
&amp;nbsp; Wire.endTransmission(); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void GameTick()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; if (gameMode==gamestart)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* game starts, show all lights */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,7);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,7); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* after 2 seconds the game begins, turn all lights off */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gamePlayer1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp =0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==gamePlayer1)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* player one is at turn, blink players one's light */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did player press his button? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = digitalRead(button1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (input ==HIGH)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = rollingPlayer1; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==gamePlayer2)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* player two is at turn, blink players two's light */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did player press his button? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = digitalRead(button2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (input ==HIGH)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = rollingPlayer2; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==rollingPlayer1)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* rolling dice for player 1 */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp &amp;lt; 15)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* rolling... */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum[0] = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum[1] = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,curNum[0]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,curNum[1]);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* after 1.5 seconds show result, till 2 seconds passed */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(&amp;amp;result1,&amp;amp;curNum,sizeof(result1));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,0);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gamePlayer2;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; else if (gameMode==rollingPlayer2)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* rolling dice for player two */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp &amp;lt; 15)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* rolling... */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum[0] = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum[1] = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,curNum[0]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,curNum[1]);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* after 1.5 seconds show result, till 2 seconds passed */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(&amp;amp;result2,&amp;amp;curNum,sizeof(result2));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,0);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gameEnd;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; else if (gameMode==gameEnd)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* was the result for player one more or equal to player two? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result1[0] + result1[1]&amp;gt;=result2[0] + result2[1])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,result1[0]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,result1[1]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink LED */&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* was the result for player two more or equal to player one? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result1[0] + result1[1]&amp;lt;=result2[0] + result2[1])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,result2[0]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,result2[1]);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink LED */&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink dice */&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,0);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did any player press a button? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((digitalRead(button1) == HIGH) ||&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (digitalRead(button2) == HIGH))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* reset game */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_1,0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(DICE_2,0);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = gamestart;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* ready for antoher tick? */&lt;br /&gt;
&amp;nbsp; if (tick==0)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; GameTick();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; /* tick,tick,tick */&lt;br /&gt;
&amp;nbsp; tick++;&lt;br /&gt;
&amp;nbsp; if (tick==100)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tick =0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* wait a bit */&lt;br /&gt;
&amp;nbsp; delay(1);&lt;br /&gt;
}&lt;/wire.h&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SwkskAE0xdI/AAAAAAAAAas/hH5T07lT9wI/s1600/IMG_9497.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SwkskAE0xdI/AAAAAAAAAas/hH5T07lT9wI/s320/IMG_9497.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SwktA3A4JfI/AAAAAAAAAa0/685ClfHXTfg/s1600/IMG_9498.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SwktA3A4JfI/AAAAAAAAAa0/685ClfHXTfg/s320/IMG_9498.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SwktUP0BIaI/AAAAAAAAAa8/WzMqRZeQmbE/s1600/IMG_9499.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SwktUP0BIaI/AAAAAAAAAa8/WzMqRZeQmbE/s320/IMG_9499.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SwktjhBNk2I/AAAAAAAAAbE/H139LEogA9Y/s1600/IMG_9500.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SwktjhBNk2I/AAAAAAAAAbE/H139LEogA9Y/s320/IMG_9500.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Swktw6P6CcI/AAAAAAAAAbM/oZiWagEmiWQ/s1600/IMG_9503.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Swktw6P6CcI/AAAAAAAAAbM/oZiWagEmiWQ/s320/IMG_9503.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkuB0BDrXI/AAAAAAAAAbU/VSgY0o8r7Uk/s1600/IMG_9505.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkuB0BDrXI/AAAAAAAAAbU/VSgY0o8r7Uk/s320/IMG_9505.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SwkuSG4jo-I/AAAAAAAAAbc/MYeA9yN7zoo/s1600/IMG_9506.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SwkuSG4jo-I/AAAAAAAAAbc/MYeA9yN7zoo/s320/IMG_9506.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Swkuw0PpxrI/AAAAAAAAAbk/F-oJYY_vr6A/s1600/IMG_9507.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Swkuw0PpxrI/AAAAAAAAAbk/F-oJYY_vr6A/s320/IMG_9507.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-size: xx-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-5305319935643798791?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uc36UAs-vTv5A1NmF0_ACyL7qAY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uc36UAs-vTv5A1NmF0_ACyL7qAY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uc36UAs-vTv5A1NmF0_ACyL7qAY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uc36UAs-vTv5A1NmF0_ACyL7qAY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/TZFyQhgqk7I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/5305319935643798791/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-putting-it.html#comment-form" title="2 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5305319935643798791?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5305319935643798791?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/TZFyQhgqk7I/project-rolling-dice-putting-it.html" title="Project: Rolling the dice, putting it together" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_t8-2yspE-3E/SwknnkKZVwI/AAAAAAAAAak/v3KZUCuxloo/s72-c/circuit_dice_1.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-putting-it.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QGSHs6eyp7ImA9WxNaEUo.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-1832423375935469251</id><published>2009-11-25T18:48:00.001+01:00</published><updated>2009-11-25T18:48:49.513+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-25T18:48:49.513+01:00</app:edited><title>Project: Rolling the dice, expanding the Arduino (PCF8574P)</title><content type="html">Last time we looked at I2C to support communication with other ICs from our Arduino. As I2C is only a communication method, we need an IC to expand the number of I/O pins&amp;nbsp; available to us, which communicates on I2C. The PCF8574P will just do that for us. Today we are going to blink a LED on distance with our Arduino.&lt;br /&gt;
&lt;br /&gt;
The pin layout for the PCF8574P is as follows:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SwkPmUvCHyI/AAAAAAAAAZ0/COsIdOjWQl0/s1600/PCF8574P.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SwkPmUvCHyI/AAAAAAAAAZ0/COsIdOjWQl0/s320/PCF8574P.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;SYMBOL PIN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DESCRIPTION&lt;br /&gt;
A0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; address input 0&lt;br /&gt;
A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp; address input 1&lt;br /&gt;
A2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp; address input 2&lt;br /&gt;
P0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp; quasi-bidirectional I/O 0&lt;br /&gt;
P1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp; quasi-bidirectional I/O 1&lt;br /&gt;
P2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp; quasi-bidirectional I/O 2&lt;br /&gt;
P3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp; quasi-bidirectional I/O 3&lt;br /&gt;
VSS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp; supply ground&lt;br /&gt;
P4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp; quasi-bidirectional I/O 4&lt;br /&gt;
P5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp; quasi-bidirectional I/O 5&lt;br /&gt;
P6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp; quasi-bidirectional I/O 6&lt;br /&gt;
P7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp; quasi-bidirectional I/O 7&lt;br /&gt;
INT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp; interrupt output (active LOW)&lt;br /&gt;
SCL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&amp;nbsp; serial clock line&lt;br /&gt;
SDA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp; serial data line&lt;br /&gt;
VDD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&amp;nbsp; supply voltage&lt;br /&gt;
&lt;br /&gt;
As we have learned, each slave IC communicating with I2C needs an address. The address is one byte long, but we have only seven bits to send as the eighth bit is an read/write indication. For the PCF8574P the address always starts with 0100, leaving us 3 bits to set. This allows us to have 8 PCF8574P slaves connected in one I2C network, because the bits 1,1,1 = 7. So we have 0 - 7 = 8 possible settings. The three bits are set by connecting the pins a0 - a2 on either Vcc (1) or ground (0). For example if I have set&amp;nbsp; A0 = 1, A1=0, A2=0 my address to control the PCF8574P&amp;nbsp; would be: 0100001.&lt;br /&gt;
&lt;br /&gt;
P0 through P7 are the input/output pins much like the ones on the Arduino. VSS is the ground connection pin, while Vdd connects to the voltage supply. INT allows you to disable the PCF8574P by placing a HIGH voltage on the pin. SCL and SDA are the familiar I2C pins which should connect to the Arduino. &lt;br /&gt;
&lt;br /&gt;
The following circuit will&amp;nbsp; require the following components:&lt;br /&gt;
1 x Arduino Duemilanove&lt;br /&gt;
1 x Red LED&lt;br /&gt;
1 x PCF8574P&lt;br /&gt;
1 x 680 Ohm resistor (blue, gray, brown, gold)&lt;br /&gt;
2 x 1.5 KOhm resistor (brown, green, red, gold) You can use up to 2 KOhm. I put 1 KOhm + 680 Ohm in series instead.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkVjiF0eFI/AAAAAAAAAZ8/TqGgRfjh7Ko/s1600/circuit_i2c_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkVjiF0eFI/AAAAAAAAAZ8/TqGgRfjh7Ko/s320/circuit_i2c_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;Note the two resistor connected to the 5 volt pin on the Arduino.The following code will blink the LED:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;#define CARD_ADR (0x4 &amp;lt;&amp;lt; 3 | 0x0) // address 0100000&lt;br /&gt;
&lt;br /&gt;
/* Include the wire header */&lt;br /&gt;
#include &lt;wire.h&gt; &lt;br /&gt;
&lt;br /&gt;
void setup ()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* setup mwiring */&lt;br /&gt;
&amp;nbsp; Wire.begin();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop ()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* set all pins off */&lt;br /&gt;
&amp;nbsp; Wire.beginTransmission(CARD_ADR);&lt;br /&gt;
&amp;nbsp; Wire.send(B00000000);&lt;br /&gt;
&amp;nbsp; Wire.endTransmission(); &lt;br /&gt;
&amp;nbsp; delay(1000); &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* set all pins on */&lt;br /&gt;
&amp;nbsp; Wire.beginTransmission(CARD_ADR);&lt;br /&gt;
&amp;nbsp; Wire.send(B11111111);&lt;br /&gt;
&amp;nbsp; Wire.endTransmission(); &lt;br /&gt;
&amp;nbsp; delay(1000);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;/wire.h&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SwkXaRMXqLI/AAAAAAAAAaE/MZAXcQWcGGU/s1600/IMG_9495.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SwkXaRMXqLI/AAAAAAAAAaE/MZAXcQWcGGU/s320/IMG_9495.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkaUMIKERI/AAAAAAAAAaM/I1ThEb7bqS8/s1600/IMG_9496.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SwkaUMIKERI/AAAAAAAAAaM/I1ThEb7bqS8/s320/IMG_9496.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
That's it for today, next time we will be completing the project!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-1832423375935469251?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hFiEOXwvOxQG_ykstnCDb8-X6WI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hFiEOXwvOxQG_ykstnCDb8-X6WI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hFiEOXwvOxQG_ykstnCDb8-X6WI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hFiEOXwvOxQG_ykstnCDb8-X6WI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/dNzJVM5B_CI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/1832423375935469251/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-expanding-arduino.html#comment-form" title="1 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1832423375935469251?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1832423375935469251?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/dNzJVM5B_CI/project-rolling-dice-expanding-arduino.html" title="Project: Rolling the dice, expanding the Arduino (PCF8574P)" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_t8-2yspE-3E/SwkPmUvCHyI/AAAAAAAAAZ0/COsIdOjWQl0/s72-c/PCF8574P.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-expanding-arduino.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYEQ3c7fCp7ImA9WxNbGUQ.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-5278703266934809776</id><published>2009-11-23T18:24:00.000+01:00</published><updated>2009-11-23T18:25:02.904+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-23T18:25:02.904+01:00</app:edited><title>Project: Rolling the dice, I2C communication</title><content type="html">Last time we build the complete game for our project. Although not fully complete, because it was missing a die. We acknowledged that the Arduino didn't have enough digital pins for our needs. Today I am going to explain the I2C communication, next time we will build a circuit expanding the Arduino.&lt;br /&gt;
&lt;br /&gt;
So let's take a look at the possibilities of the Arduino to communicate with other ICs:&lt;br /&gt;
- You can communicate using digital pins. You'll have to write code to HIGH/LOW them according to the protocol. This will take a long time and a lot of useful digital pins.&lt;br /&gt;
- Of course we have Serial/USB, enabling the Arduino to communicate with your PC or other arduinos. Not really easy and won't allow sketch uploads to your Arduino until you reset.&lt;br /&gt;
- Dallas one-wired interface allows you to communicate with other ICs that support it. Will require a digital pin.&lt;br /&gt;
- I2C is more common, and the Arduino supports it nicely.&lt;br /&gt;
&lt;br /&gt;
So how does I2C work? The protocol requires a master IC and one or more slaves. I2C has two wires required for communication: a data and a clock.&amp;nbsp; The master will provide the clock (required for the other IC's to be able to tell when to read the data pin). Both wires should be hooked up with the volt supply with a 4.7 KOhm resistor. This is because when not sending data the line should be HIGH. When an IC decides to send data, it will pull down the data line to LOW (0) or leave it at HIGH (1) for one clock cycle. Each slave will have an address on which it will listen for data.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SwgQlh4wskI/AAAAAAAAAZQ/ACjL6r1yeFw/s1600/i2c.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SwgQlh4wskI/AAAAAAAAAZQ/ACjL6r1yeFw/s320/i2c.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The Arduino allows you to hook up many devices with I2C and can operate in master or slave mode using the supplied wire.h addition. Using analog pin 4 and 5 to hook up the Arduino, it will allow you to use all the 13 digital pins for other use.&lt;br /&gt;
&lt;br /&gt;
By calling &lt;br /&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;Wire.begin();&lt;/pre&gt;in the setup function you can start using I2C.&lt;br /&gt;
&lt;br /&gt;
When you need to send data call to start transmission&lt;br /&gt;
&lt;pre&gt;Wire.beginTransmission(address);
&lt;/pre&gt;send data using&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Wire.send (data)&lt;/pre&gt;and end the transmission with&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Wire.endTransmission();
&lt;/pre&gt;.&amp;nbsp; What data you need to send depends on what the other IC is expecting. I2C only defines the protocol to send data. You can also read data from other devices with the Arduino, but how depends also on what th slave device is expecting.&lt;br /&gt;
&lt;br /&gt;
So that's the theory. Please check next time on how to put it into practice.&lt;br /&gt;
&lt;h2&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=2479467600094354675&amp;amp;postID=5278703266934809776" id="i2c" name="i2c"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-5278703266934809776?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9dObHStoORK3aNBxNCQAhVB6mEk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9dObHStoORK3aNBxNCQAhVB6mEk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9dObHStoORK3aNBxNCQAhVB6mEk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9dObHStoORK3aNBxNCQAhVB6mEk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/P-XKi5QN_UM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/5278703266934809776/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-i2c-communication.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5278703266934809776?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/5278703266934809776?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/P-XKi5QN_UM/project-rolling-dice-i2c-communication.html" title="Project: Rolling the dice, I2C communication" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_t8-2yspE-3E/SwgQlh4wskI/AAAAAAAAAZQ/ACjL6r1yeFw/s72-c/i2c.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-i2c-communication.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcBQn07eip7ImA9WxNbGEw.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-7535134197238252043</id><published>2009-11-21T15:14:00.001+01:00</published><updated>2009-11-21T15:17:33.302+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-21T15:17:33.302+01:00</app:edited><title>Project: Rolling the dice, reading input</title><content type="html">Part of our game will be pressing a button to role the dice. Last time we build a die. Today we will see how to read input from a player to role the die and play the game.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Because we have two players, we will need two buttons. A button input is digital, it's either pressed or not. This means we can use it on our Arduino as digital input. The Arduino has 13 digital I/O pins, each configurable as either input or output.&lt;br /&gt;
&lt;br /&gt;
The following circuit will require the following items:&lt;br /&gt;
8 x Red LED (1 LED for player two)&lt;br /&gt;
1 x Green LED (player one)&lt;br /&gt;
1 x Arduino Duemilanove&lt;br /&gt;
1 x 680 Ohm Resistor (blue, gray, brown, gold)&lt;br /&gt;
2 x 10 KOhm resistor (brown, black, orange, gold) &lt;br /&gt;
2 x press-to-connect buttons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SwfunpXmlqI/AAAAAAAAAY4/JImSotQgHR0/s1600/circuit_arduino_dice_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SwfunpXmlqI/AAAAAAAAAY4/JImSotQgHR0/s320/circuit_arduino_dice_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The 10 Kohm resistors are required to avoid the Arduino to misread the input pin when the button is unpressed. If not connected with an resistor, the Arduino will randomly see the button as pressed.&lt;br /&gt;
&lt;br /&gt;
The following code will enable us to play the game with one die:&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;br /&gt;
/* translate pin numbers into something human readable */&lt;br /&gt;
int dicePinstart =2;&lt;br /&gt;
int light1 = 9;&lt;br /&gt;
int light2 = 10;&lt;br /&gt;
int button1 = 11;&lt;br /&gt;
int button2 = 12;&lt;br /&gt;
&lt;br /&gt;
/* game modes */&lt;br /&gt;
int gamestart = 0;&lt;br /&gt;
int gamePlayer1 =1;&lt;br /&gt;
int gamePlayer2 = 2;&lt;br /&gt;
int rollingPlayer1 = 3;&lt;br /&gt;
int rollingPlayer2 = 4;&lt;br /&gt;
int gameEnd = 5;&lt;br /&gt;
int gameMode = gamestart;&lt;br /&gt;
int curNum;&lt;br /&gt;
int result1;&lt;br /&gt;
int result2;&lt;br /&gt;
&lt;br /&gt;
/* keep track of the gameticks */&lt;br /&gt;
int tick=0;&lt;br /&gt;
int tmp=0;&lt;br /&gt;
bool tmpBool;&lt;br /&gt;
int input;&lt;br /&gt;
&lt;br /&gt;
/* different modes for the die */&lt;br /&gt;
int dicemode[8][7] =&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; {0,0,0,0,0,0,0}&lt;br /&gt;
&amp;nbsp; ,{0,0,0,1,0,0,0}&lt;br /&gt;
&amp;nbsp; ,{1,0,0,0,0,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,0,1,0,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,1,0,1,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,1,1,1,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,1,1,0,1,1,1}&lt;br /&gt;
&amp;nbsp; ,{1,1,1,1,1,1,1}&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int curmode[8];&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* define die LEDs as output */&lt;br /&gt;
&amp;nbsp; for (int i = 0; i&amp;lt;10; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pinMode(dicePinstart+i, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; /* define player LEDs as output */&amp;nbsp; &lt;br /&gt;
&amp;nbsp; pinMode(light1, OUTPUT); &lt;br /&gt;
&amp;nbsp; pinMode(light2, OUTPUT); &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* define player buttons as input */&lt;br /&gt;
&amp;nbsp; pinMode(button1, INPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; pinMode(button2, INPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* reset the die to no die mode 0 */&lt;br /&gt;
&amp;nbsp; setDiceMode(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void setDiceMode(int num)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* copy a die mode into the current diemode */&lt;br /&gt;
&amp;nbsp; memcpy(curmode,&amp;amp;dicemode[num],sizeof(curmode)); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void showDice()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* base on the value for the LED in the current die mode, either enable or diable the LED */&lt;br /&gt;
&amp;nbsp; for (int i = 0; i&amp;lt;7; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (curmode[i]==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(dicePinstart+i, HIGH);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(dicePinstart+i, LOW);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void GameTick()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* this funcction will handle game modes*/&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; if (gameMode==gamestart)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* a new game starts, enable all LEDs to test them */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(7);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* count till 20 (2 seconds) */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* switch to another gamemode and disable all LEDs*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gamePlayer1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp =0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==gamePlayer1)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* we want the player LED to blink */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* does the player press his button? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = digitalRead(button1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (input ==HIGH)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* yes he did, role the die */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = rollingPlayer1; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==gamePlayer2)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* we want the player LED to blink */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* does the player press his button? */ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = digitalRead(button2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (input ==HIGH)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* yes he did, role the die */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = rollingPlayer2; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else if (gameMode==rollingPlayer1)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* role for 1.5 seconds, show the results for 0.5 seconds and continue */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp &amp;lt; 15)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* choose a random number */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(curNum);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 2.0 seconds are up, the other player is at turn. reset die and player LED */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result1 = curNum;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gamePlayer2;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (gameMode==rollingPlayer2)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* role for 1.5 seconds, show the results for 0.5 seconds and continue */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp &amp;lt; 15)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* choose a random number */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curNum = random(1,6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(curNum);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp == 20)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 2.0 seconds are up, the game ends. reset die and player LED */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result2= curNum;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode=gameEnd;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; else if (gameMode==gameEnd)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* we want the result to blink */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpBool=!tmpBool;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did player one win, or played a tie? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result1&amp;gt;=result2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink his LED */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(result1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did player two win, or played a tie? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result1&amp;lt;=result2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink his LED */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(result2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* blink the die */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!tmpBool)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* did either player pressed his button? */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((digitalRead(button1) == HIGH) ||&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (digitalRead(button2) == HIGH))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* reset game */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light1, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(light2, LOW);&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gameMode = gamestart;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; /* ready for antohter game tick? */&lt;br /&gt;
&amp;nbsp; if (tick==0)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; GameTick();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* tick, tick, tick */&lt;br /&gt;
&amp;nbsp; tick++;&lt;br /&gt;
&amp;nbsp; if (tick==100)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tick =0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* wait a bit */&lt;br /&gt;
&amp;nbsp; delay(1);&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Swf2GdOJKBI/AAAAAAAAAZA/dkiU8llALBg/s1600/IMG_9493.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Swf2GdOJKBI/AAAAAAAAAZA/dkiU8llALBg/s320/IMG_9493.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Swf2d5yMUbI/AAAAAAAAAZI/eo8p1ogBEeE/s1600/IMG_9494.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Swf2d5yMUbI/AAAAAAAAAZI/eo8p1ogBEeE/s320/IMG_9494.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Well that's about it. We are able to play the game... with one die. But we do need two dice. The solution would be simple to connect another 7 LEDs with the Arduino, if the Arduino had another 7 pins left. So we need to extend the Arduino. How? See you later ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-7535134197238252043?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XDMlOt2cKh33EQ5kOfyG6oczK2M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XDMlOt2cKh33EQ5kOfyG6oczK2M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XDMlOt2cKh33EQ5kOfyG6oczK2M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XDMlOt2cKh33EQ5kOfyG6oczK2M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/fpkNTRApe_0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/7535134197238252043/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-reading-input.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/7535134197238252043?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/7535134197238252043?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/fpkNTRApe_0/project-rolling-dice-reading-input.html" title="Project: Rolling the dice, reading input" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_t8-2yspE-3E/SwfunpXmlqI/AAAAAAAAAY4/JImSotQgHR0/s72-c/circuit_arduino_dice_2.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-reading-input.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUNQH45eSp7ImA9WxNbFUs.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3022257401792785194</id><published>2009-11-18T19:18:00.000+01:00</published><updated>2009-11-18T19:18:11.021+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-18T19:18:11.021+01:00</app:edited><title>Project: rolling the dice, building a die</title><content type="html">Part one of dice project is to show the pips of a die with LEDs. To do this we require seven LEDs. With these LED we can show every side of the die by light the correct LEDs. But we do need a way to do this. Luckily with the Arduino we have 13 digital pins which we can enable/disable as we please. &lt;br /&gt;
&lt;br /&gt;
The following circuit will show the LEDs and the Arduino to make the die. You will need the following components:&lt;br /&gt;
&lt;br /&gt;
7 x Red LED&lt;br /&gt;
1 x Arduino Duemilanove&lt;br /&gt;
1 x 680 Ohm Resistor (blue, gray, brown, gold)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SwQwmMP-nXI/AAAAAAAAAYo/73xvyz79T8Y/s1600/circuit_arduino_dice_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SwQwmMP-nXI/AAAAAAAAAYo/73xvyz79T8Y/s320/circuit_arduino_dice_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The following code will show all sides of the dice:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
/* first pin connected to a LED */&lt;br /&gt;
int dicePinstart =2;&lt;br /&gt;
&lt;br /&gt;
/* the different states for each LED for each side of the die&amp;nbsp; */&lt;br /&gt;
int dicemode[8][7] =&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; {0,0,0,0,0,0,0}&lt;br /&gt;
&amp;nbsp; ,{0,0,0,1,0,0,0}&lt;br /&gt;
&amp;nbsp; ,{1,0,0,0,0,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,0,1,0,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,1,0,1,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,0,1,1,1,0,1}&lt;br /&gt;
&amp;nbsp; ,{1,1,1,0,1,1,1}&lt;br /&gt;
&amp;nbsp; ,{1,1,1,1,1,1,1}&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
/* current side of the die to show */&lt;br /&gt;
int curmode[8];&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* set all connected pins as output */&lt;br /&gt;
&amp;nbsp; for (int i = 0; i&amp;lt;10; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pinMode(dicePinstart+i, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* initialize the die as 0 */ &lt;br /&gt;
&amp;nbsp; setDiceMode(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void setDiceMode(int num)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* copy a side of the die to the current die buffer */&lt;br /&gt;
&amp;nbsp; memcpy(curmode,&amp;amp;dicemode[num],sizeof(curmode)); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void showDice()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* for each LED check if it should be enabled for the current die side */&lt;br /&gt;
&amp;nbsp; for (int i = 0; i&amp;lt;7; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (curmode[i]==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(dicePinstart+i, HIGH);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(dicePinstart+i, LOW);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; /* loop through the sides of the die */&lt;br /&gt;
&amp;nbsp; for (int i = 0; i &amp;lt;8; i++)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* set current side of the die */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setDiceMode(i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /*enable the LEDs */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; showDice();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SwQ6XOvOJaI/AAAAAAAAAYw/dOgtx4uZ2-w/s1600/IMG_9491.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SwQ6XOvOJaI/AAAAAAAAAYw/dOgtx4uZ2-w/s320/IMG_9491.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3022257401792785194?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/s4k1pbrbjmR8dGuyHWdbmXIe108/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s4k1pbrbjmR8dGuyHWdbmXIe108/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/s4k1pbrbjmR8dGuyHWdbmXIe108/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s4k1pbrbjmR8dGuyHWdbmXIe108/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/So3dWlxtRYE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3022257401792785194/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-building-die.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3022257401792785194?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3022257401792785194?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/So3dWlxtRYE/project-rolling-dice-building-die.html" title="Project: rolling the dice, building a die" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_t8-2yspE-3E/SwQwmMP-nXI/AAAAAAAAAYo/73xvyz79T8Y/s72-c/circuit_arduino_dice_1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rolling-dice-building-die.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcHSH4-eSp7ImA9WxNbE0Q.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3885900490807452145</id><published>2009-11-15T14:13:00.027+01:00</published><updated>2009-11-16T17:47:19.051+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-16T17:47:19.051+01:00</app:edited><title>Project: rolling the dice</title><content type="html">Time for a new project. This time we are going to build a simple game: Rolling the dice. The game works as follows:&lt;br /&gt;
&lt;br /&gt;
1. Player one presses a button, the dice will role&lt;br /&gt;
2. The result of the throw is shown.&lt;br /&gt;
3. Player two presses a button, the dice will role&lt;br /&gt;
4. The result of the throw is shown.&lt;br /&gt;
5. The player with the highest amount of pips wins&lt;br /&gt;
6. When any button is pressed, the game resets.&lt;br /&gt;
&lt;br /&gt;
To indicate the player it's his turn, a LED will blink near his button. A throw will show random numbers on the dice for a while, which pauses after a second showing the result. When a player wins, the winning result and his LED will blink. When the game ends in a tie, both players win.&lt;br /&gt;
&lt;br /&gt;
During this project we will learn about communicating with others IC's using I2C. We will learn how to expand the number of I/O pins on the Arduino. Also we be able to read buttons and build dice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3885900490807452145?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6kP4dYPbZY9x6BCGH1U3pOUdUug/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6kP4dYPbZY9x6BCGH1U3pOUdUug/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6kP4dYPbZY9x6BCGH1U3pOUdUug/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6kP4dYPbZY9x6BCGH1U3pOUdUug/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/2gTCwvYOK2k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3885900490807452145/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-rollin.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3885900490807452145?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3885900490807452145?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/2gTCwvYOK2k/project-rollin.html" title="Project: rolling the dice" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-rollin.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkADRHs_eCp7ImA9WxNbEkQ.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-2030263439213972564</id><published>2009-11-13T19:43:00.001+01:00</published><updated>2009-11-15T14:12:55.540+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-15T14:12:55.540+01:00</app:edited><title>Circuit basics: Replacement resistance</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;We have already learned about resistance in circuits. A nice feature of resistance is that you can avoid having many resistors for LEDs in parallel. This can be done by replacing them by one resistor with another resistance. This resistance can be caculated like:&lt;br /&gt;
&lt;br /&gt;
1/Rreplacement = 1/R1 + 1/R2 + 1/RN.&lt;br /&gt;
&lt;br /&gt;
For example, replace 2x680 Ohm resistors:&lt;br /&gt;
&lt;br /&gt;
1/680 + 1/680 = 0.0029&lt;br /&gt;
1/0.009 = 340 Ohm.&lt;br /&gt;
&lt;br /&gt;
Or replace 3 resistors:&lt;br /&gt;
&lt;br /&gt;
1/680 + 1/680 + 1/680 = 0.004&lt;br /&gt;
1/0.004 = 226 Ohm.&lt;br /&gt;
&lt;br /&gt;
The following circuit proves this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Sv2djupVzvI/AAAAAAAAAYg/A6rTSFUquc8/s1600-h/replacement+resistance.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Sv2djupVzvI/AAAAAAAAAYg/A6rTSFUquc8/s320/replacement+resistance.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-2030263439213972564?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M_RqNp4lDaWK2pwfry4miRFU6Qc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M_RqNp4lDaWK2pwfry4miRFU6Qc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M_RqNp4lDaWK2pwfry4miRFU6Qc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M_RqNp4lDaWK2pwfry4miRFU6Qc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/g_xlMHz5OMg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/2030263439213972564/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/circuit-basics-replacement-resistance.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/2030263439213972564?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/2030263439213972564?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/g_xlMHz5OMg/circuit-basics-replacement-resistance.html" title="Circuit basics: Replacement resistance" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_t8-2yspE-3E/Sv2djupVzvI/AAAAAAAAAYg/A6rTSFUquc8/s72-c/replacement+resistance.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/circuit-basics-replacement-resistance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IGRno7cCp7ImA9WxNUGUg.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-655317759459292788</id><published>2009-11-11T18:12:00.000+01:00</published><updated>2009-11-11T18:12:07.408+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-11T18:12:07.408+01:00</app:edited><title>Electronic component: The Seven-segment display</title><content type="html">A personal favorite this time, the seven-segment display. It's pretty cool to see output this way. Later on I will blog about the four digit brother, but today we will build a counter using the Arduino and a seven-segment display.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SviLktXMIiI/AAAAAAAAAXw/w6EP-70EdTQ/s1600-h/leddisplay.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SviLktXMIiI/AAAAAAAAAXw/w6EP-70EdTQ/s320/leddisplay.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The seven-segment display consists of 8 segments, also counting the dot. Each segment is an individual LED. The type I used has two vcc pins, this middle ones, and 1 pin for each segment.&lt;br /&gt;
&lt;br /&gt;
To show the digits we are going to build the following circuit. Note that you might have a seven-segment display which has a gnd pin instead of a vcc pin. This way you won't need the transistors as I need did.&lt;br /&gt;
&lt;br /&gt;
The shopping list is as follows:&lt;br /&gt;
1 x Arduino Duemilanove&lt;br /&gt;
1 x seven-segment display (vcc in)&lt;br /&gt;
7 x 10 kOhm resisitor (brown, black, orange)&lt;br /&gt;
7 x transistor (C547B)&lt;br /&gt;
1 x 150 Ohm resistor (brown, green, brown)&lt;br /&gt;
1 x USB connector cable&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SviO0_R0VwI/AAAAAAAAAYA/9jqH2759rtU/s1600-h/circuit_7segment_1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SviO0_R0VwI/AAAAAAAAAYA/9jqH2759rtU/s640/circuit_7segment_1.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Using the 5 Volt and ground pin on the Arduino board, we can power the circuit. The pins dig7 - dig 13 are connected to the transistors. By enabling a pin a current will flow through the corresponding segment.&lt;br /&gt;
&lt;br /&gt;
Well that's the first part. Up next is programming the Arduino. This is quite annoying, as we'll have to tell the arduino which pins to enable for each digit. While running the Arduino will count till 10, on which it will start over with 0.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
/* define the segments */&lt;br /&gt;
&amp;nbsp;int ledPinMid =&amp;nbsp; 13;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int ledPinLeftUp =&amp;nbsp; 12;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int ledPinUp =&amp;nbsp; 11;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int ledPinRightUp =&amp;nbsp; 10;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int ledPinLeftDown =&amp;nbsp; 9; &lt;br /&gt;
&amp;nbsp;int ledPinDown =&amp;nbsp; 8;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int ledPinRightDown =&amp;nbsp; 7;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;int i =0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;void setup()&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; // initialize the digital pins as output:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinMid, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinLeftUp, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinUp, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinRightUp, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinLeftDown, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinDown, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; pinMode(ledPinRightDown, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;void clear()&lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftDown, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, LOW); &lt;br /&gt;
&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, LOW); &lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;void setNumber(int number)&lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; /* disable all pins */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; clear();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; /* enable the pins for the current number */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; switch (number)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 1:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 2:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 3:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 4:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 5:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 6:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 7:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 8:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 9:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinMid, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightUp, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinRightDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinLeftDown, HIGH); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(ledPinDown, HIGH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;// the loop() method runs over and over again,&lt;br /&gt;
&amp;nbsp;// as long as the Arduino has power&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;void loop()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* set current number */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setNumber(i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; i ++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (i == 10) // after 10 second, reset&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000); // wait for a second&lt;br /&gt;
&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: small;"&gt;Well that's it for today. Let's take a look at the result.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SviRxlUO65I/AAAAAAAAAYQ/mMf4ZNBBKb0/s1600-h/circuit_7segment_result_2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SviRxlUO65I/AAAAAAAAAYQ/mMf4ZNBBKb0/s320/circuit_7segment_result_2.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SviR7wyFu_I/AAAAAAAAAYY/CLD23496BKc/s1600-h/circuit_7segment_result_3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SviR7wyFu_I/AAAAAAAAAYY/CLD23496BKc/s320/circuit_7segment_result_3.JPG" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SviRniivwEI/AAAAAAAAAYI/Wf3q9L42RMU/s1600-h/circuit_7segment_result_1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SviRniivwEI/AAAAAAAAAYI/Wf3q9L42RMU/s320/circuit_7segment_result_1.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-655317759459292788?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w1BcAT1crucjiam_11IAbjGRdC8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1BcAT1crucjiam_11IAbjGRdC8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w1BcAT1crucjiam_11IAbjGRdC8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1BcAT1crucjiam_11IAbjGRdC8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/bT6NwL2zwhM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/655317759459292788/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-seven-segment.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/655317759459292788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/655317759459292788?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/bT6NwL2zwhM/electronic-component-seven-segment.html" title="Electronic component: The Seven-segment display" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_t8-2yspE-3E/SviLktXMIiI/AAAAAAAAAXw/w6EP-70EdTQ/s72-c/leddisplay.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-seven-segment.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkICQn0ycCp7ImA9WxNUGE0.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-9161454162106330967</id><published>2009-11-09T22:02:00.000+01:00</published><updated>2009-11-09T22:02:43.398+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-09T22:02:43.398+01:00</app:edited><title>Electronic component: The Arduino board</title><content type="html">Besides the PICAXE, another popular PIC exists for the electronic hobbyist:&lt;a href="http://www.arduino.cc/"&gt; the Arduino&lt;/a&gt;. Actually, the PICs in use are Atmegas, Arduino is the platform making it easy for people to use the PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh9syDj81I/AAAAAAAAAXY/8TUQrLkm4D0/s1600-h/arduino.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh9syDj81I/AAAAAAAAAXY/8TUQrLkm4D0/s320/arduino.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
The Arduino family consits of a few different boards. I'll be using the Duemilanove, as displayed above, but many more are available for different needs. The Duemilanove has 13 digital input/output pins, 5 analog and an USB connector. Today we'll cover the process of programming an Arduino.&lt;br /&gt;
&lt;br /&gt;
What I like the most about the Arduino platform is that it's all open-source. Except for the PIC that is. The software to program the chip is written in C++ and runs on most platforms. Here is a screenshot:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh8Z95fxXI/AAAAAAAAAXQ/Nh5znEmntRs/s1600-h/Screenshot-Blink+%7C+Arduino+0017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh8Z95fxXI/AAAAAAAAAXQ/Nh5znEmntRs/s320/Screenshot-Blink+%7C+Arduino+0017.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The proces of programming the Arduino is very simple actually. You write the software and press upload to upload it to the Arduino. The Arduino Duemilanove can be connected to your PC by USB with a USB connector cable.&lt;br /&gt;
&lt;br /&gt;
We are going to built a blink LED, as always ;) The following circuit will show nothing really. It's nothing more than connecting the Arduino to your PC an a LED between digital 13 and the ground. The shopping list for the circuit is:&lt;br /&gt;
&lt;br /&gt;
1 x USB connector cable&lt;br /&gt;
1 x Arduino Duemilanove (check Sparkfun.com, it seems to be the cheapest)&lt;br /&gt;
1 x red LED&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh_3qwI7MI/AAAAAAAAAXg/5Xp7RRA5PzI/s1600-h/circuit_arduino_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh_3qwI7MI/AAAAAAAAAXg/5Xp7RRA5PzI/s320/circuit_arduino_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;You can open the default Blink example from the file menu (file &amp;gt; examples &amp;gt; digital &amp;gt; blink). Every program has at least a setup function (this code is run as initialization) and a loop function (which is repeated between power up and power down of the board). In the setup function the digital pin 13 is enabled as output. In the loop the output on 13 is set to HIGH, wait for a second, set to LOW and again wait for a second. Nothing really fancy. Upload the program and enjoy the coolness.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SviDahKmaHI/AAAAAAAAAXo/JE4aOAjXubc/s1600-h/circuit_arduino_result_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SviDahKmaHI/AAAAAAAAAXo/JE4aOAjXubc/s320/circuit_arduino_result_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-9161454162106330967?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7QJ3t-ZT8AuKhF_25Nj4626vqvg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7QJ3t-ZT8AuKhF_25Nj4626vqvg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7QJ3t-ZT8AuKhF_25Nj4626vqvg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7QJ3t-ZT8AuKhF_25Nj4626vqvg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/0LTlxQZscQA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/9161454162106330967/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-arduino-board.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/9161454162106330967?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/9161454162106330967?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/0LTlxQZscQA/electronic-component-arduino-board.html" title="Electronic component: The Arduino board" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_t8-2yspE-3E/Svh9syDj81I/AAAAAAAAAXY/8TUQrLkm4D0/s72-c/arduino.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-arduino-board.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YFR3cycSp7ImA9WxNUFU8.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3435988558758235618</id><published>2009-11-06T17:31:00.000+01:00</published><updated>2009-11-06T17:31:56.999+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-06T17:31:56.999+01:00</app:edited><title>Project: The light-o-meter</title><content type="html">Ok, this is the final chapter in the &lt;a href="http://circuitsforbeginners.blogspot.com/2009/10/project-building-light-meter-1.html"&gt;project&lt;/a&gt;. We are going to build the actual meter. In the previous postings we've learned to program the PICAXE and use the LDR. Up next is to combine these into one circuit.&lt;br /&gt;
&lt;br /&gt;
One nice feature of the PICAXE 18X is to be able to read analog components, by connecting them to an input pin. This will have to be either input0 (pin 17) or input1 (pin 18) as they have ADC support.&lt;br /&gt;
&lt;br /&gt;
This is how the meter is going to work. The LDR will be used by the PICAXE to determine the amount of light. Based on the amount of light LEDs will be lit or unlit. The more light, the more LEDs will be lit.&lt;br /&gt;
&lt;br /&gt;
For the following circuit we will require these items:&lt;br /&gt;
1 x 9V Battery&lt;br /&gt;
1 x LDR&lt;br /&gt;
1 x 10 kOhm resistor (brrown, black, orange)&lt;br /&gt;
1 x 4.7 kOhm resistor (I still use three)&lt;br /&gt;
8 x 1 kOhm resistor (brown, black, red)&lt;br /&gt;
8 x&amp;nbsp; C547B transistor&lt;br /&gt;
3 x green LED&lt;br /&gt;
3 x yellow LED&lt;br /&gt;
2 x red LED&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SvRIrSq8X9I/AAAAAAAAAWA/EjeHl4YMfZQ/s1600-h/circuit_picaxe_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SvRIrSq8X9I/AAAAAAAAAWA/EjeHl4YMfZQ/s320/circuit_picaxe_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Ok, here we go. Step by step:&lt;br /&gt;
&lt;br /&gt;
1. Place the PICAXE on the board, like the last time.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRKW8H5hLI/AAAAAAAAAWI/uZKYqaFAP7s/s1600-h/IMG_9342.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRKW8H5hLI/AAAAAAAAAWI/uZKYqaFAP7s/s320/IMG_9342.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
2. Put the 8 LEDs on the board&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRKzbJHeBI/AAAAAAAAAWQ/NVhHky6lKik/s1600-h/IMG_9344.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRKzbJHeBI/AAAAAAAAAWQ/NVhHky6lKik/s320/IMG_9344.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;3. For each LED, put a resistor between the LED and ground.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRLGHhPG8I/AAAAAAAAAWY/GTqhMKWLNQo/s1600-h/IMG_9345.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRLGHhPG8I/AAAAAAAAAWY/GTqhMKWLNQo/s320/IMG_9345.JPG" /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
4. For each LED add a transistor to the board. Whatch carefully how to connect them.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SvRLsoRMWpI/AAAAAAAAAWg/Lj8rndK4tmQ/s1600-h/IMG_9346.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SvRLsoRMWpI/AAAAAAAAAWg/Lj8rndK4tmQ/s320/IMG_9346.JPG" /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;5. Connect each transistor to the appropriate pin on the PICAXE. See the pin layout in the previous post for more details.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRMM5r0H5I/AAAAAAAAAWo/7hWjimR3O8Y/s1600-h/IMG_9347.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRMM5r0H5I/AAAAAAAAAWo/7hWjimR3O8Y/s320/IMG_9347.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;6. Connect an LDR to the + pole, and the 10kOhm resistor. The resistor should be connected to the - pole. Connect input 1 of the PICAXE to the LDR and resistor.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRNGhcRSEI/AAAAAAAAAWw/BwG_dQILkpY/s1600-h/IMG_9350.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRNGhcRSEI/AAAAAAAAAWw/BwG_dQILkpY/s320/IMG_9350.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;7. Review the result before you blow anything up ;)&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRNYCBzfSI/AAAAAAAAAW4/dCk6gqb6LxA/s1600-h/IMG_9349.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvRNYCBzfSI/AAAAAAAAAW4/dCk6gqb6LxA/s320/IMG_9349.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;8. upload the following code into the PICAXE:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;main: &lt;br /&gt;
readadc 1, b0 'Read the amount of light 0=dark 255=very much &lt;br /&gt;
&lt;br /&gt;
'Is it very bright? put led 7 on &lt;br /&gt;
if b0 &amp;gt; 230 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 7 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 7 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it less very bright? put led 6 on &lt;br /&gt;
if b0 &amp;gt; 200 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 6 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 6 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it bright? put led 5 on &lt;br /&gt;
if b0 &amp;gt; 180 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 5 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 5 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it medium bright? put led 4 on &lt;br /&gt;
if b0 &amp;gt; 150 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high 4&amp;nbsp; &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 4 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it below medium? put led 3 on &lt;br /&gt;
if b0 &amp;gt; 120 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 3 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 3 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it between dark and medium bright? put led 2 on &lt;br /&gt;
if b0 &amp;gt; 90 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 2 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 2 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it less dark? put led 1 on &lt;br /&gt;
if b0 &amp;gt; 60 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 1 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 1 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
'Is it quite dark? put led 0 on &lt;br /&gt;
if b0 &amp;gt; 30 then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; high&amp;nbsp; 0 &lt;br /&gt;
else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; low 0 &lt;br /&gt;
end if &lt;br /&gt;
&lt;br /&gt;
goto main&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SvRPP4xTcvI/AAAAAAAAAXA/-OEbAHGZBYw/s1600-h/IMG_9352.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SvRPP4xTcvI/AAAAAAAAAXA/-OEbAHGZBYw/s320/IMG_9352.JPG" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRPcspyOsI/AAAAAAAAAXI/UluL0uN-8dI/s1600-h/IMG_9353.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SvRPcspyOsI/AAAAAAAAAXI/UluL0uN-8dI/s320/IMG_9353.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3435988558758235618?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dcmft_VyRD4vaJXpcTAdp6FAjYY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dcmft_VyRD4vaJXpcTAdp6FAjYY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dcmft_VyRD4vaJXpcTAdp6FAjYY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dcmft_VyRD4vaJXpcTAdp6FAjYY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/7taYpJbivuM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3435988558758235618/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/project-light-o-meter.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3435988558758235618?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3435988558758235618?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/7taYpJbivuM/project-light-o-meter.html" title="Project: The light-o-meter" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/SvRIrSq8X9I/AAAAAAAAAWA/EjeHl4YMfZQ/s72-c/circuit_picaxe_2.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/project-light-o-meter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEECQnY7cSp7ImA9WxNUE0g.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-2573980870581809152</id><published>2009-11-04T18:44:00.000+01:00</published><updated>2009-11-04T18:44:23.809+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-04T18:44:23.809+01:00</app:edited><title>Electronic component: The PICAXE</title><content type="html">For our &lt;a href="http://circuitsforbeginners.blogspot.com/2009/10/project-building-light-meter-1.html"&gt;project &lt;/a&gt;we are going to use a PICAXE, today we are going to learn what the PICAXE is and how to program it. This we will be doing by building a circuit which is sending out an SOS signal in Morse code.&lt;br /&gt;
&lt;br /&gt;
The PIXAXE is a PIC. IC stands for integrated circuit, as we already have learned. PIC stands for programmable integrated circuit. This means that you can write code and upload it onto the chip. Based on input you can set a different output.&lt;br /&gt;
&lt;br /&gt;
For the project I've used an PICAXE 18X, but there are many different types of PICAXE chips. Also different PICs exist, for example the Atmel chips which we will meet later on.&lt;br /&gt;
&lt;br /&gt;
As we are about to program a PIXAXE, we do require some items. I bought them at &lt;a href="http://www.sparkfun.com/"&gt;SparkFun&lt;/a&gt;, which seem to be nice guys. For today's circuit, this is what we need:&lt;br /&gt;
1 x PICAXE 18X (Some other PICAXEs will be ok too, but you are on your own ;))&lt;br /&gt;
1 x PICAXE Serial programmer cable&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Su84yqJgDyI/AAAAAAAAATo/-lutW7LV0F0/s1600-h/picaxeserprogcable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Su84yqJgDyI/AAAAAAAAATo/-lutW7LV0F0/s320/picaxeserprogcable.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;1 x PICAXE Bread board adapter (instead you might want to get the PICAXE 18 pin power project board, but I found this to be more flexible, although you will have to solder it)&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Su88iGaZcwI/AAAAAAAAAUI/QtDaoKis7uo/s1600-h/picaxebreadboardadap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Su88iGaZcwI/AAAAAAAAAUI/QtDaoKis7uo/s320/picaxebreadboardadap.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
1 x USBtoRS232 converter, as my PC doesn't have a serial port.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Su85289rgvI/AAAAAAAAATw/W9VuBM7sdI0/s1600-h/usbtors232.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Su85289rgvI/AAAAAAAAATw/W9VuBM7sdI0/s320/usbtors232.jpg" /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;1 x USB connector cable&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Su86M7DNzJI/AAAAAAAAAT4/ULhgr48HCNY/s1600-h/usb+cable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Su86M7DNzJI/AAAAAAAAAT4/ULhgr48HCNY/s320/usb+cable.jpg" /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;1 x 9V battery&lt;br /&gt;
1 x 4,7 kOhm (I used 2 x 2.2 kOhm + 1 x 330 Ohm in series, as I didn't have one)&lt;br /&gt;
1 x green LED&lt;br /&gt;
&lt;br /&gt;
Well, that's about it. Here is the circuit we are going to build:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Su87grMra1I/AAAAAAAAAUA/RAHzCQHzTdk/s1600-h/circuit_picaxe_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Su87grMra1I/AAAAAAAAAUA/RAHzCQHzTdk/s320/circuit_picaxe_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;To imitate the PICAXE Bread board adapter, I've used three signal input symbols. It's pretty straightforward I guess. Note that this is the actual pin layout for the PICAXE 18X:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Su89GTufc7I/AAAAAAAAAUQ/oRBEQvtdUUo/s1600-h/PICAXE-18X_Pinout.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Su89GTufc7I/AAAAAAAAAUQ/oRBEQvtdUUo/s320/PICAXE-18X_Pinout.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;Ok, once you have connected everything, including the serial and USB cable, we can start programming the PICAXE. As I use Linux I'll be using AXEpad, which is really easy to use. For Windows you will probably have to set up some drivers and download another program. The code for the PICAXE will be the same anyway, so here we go:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;main: ' start here &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 200 ' wait 200 msec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub long ' jump to long &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub long ' jump to long &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub long ' jump to long &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 200 ' wait 200 msec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;gosub short ' jump to short&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 3000 ' wait 3 sec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;goto main ' jump back to main &lt;br /&gt;
&lt;br /&gt;
short:&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;high 4&amp;nbsp;&amp;nbsp; ' Set output 4 to ON &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; pause 100 ' wait 100 msec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;low 4&amp;nbsp;&amp;nbsp; ' Set output 4 to OFF &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 100 ' wait 100 msec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;return&amp;nbsp; ' Jump back to main &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
long: &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;high 4&amp;nbsp; ' Set output 4 to ON &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 300 ' wait 300 msec &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; low 4&amp;nbsp; ' Set output 4 to OFF &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;pause 300 ' wait 300 msec &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;return&amp;nbsp; ' Jump back to main&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The code is pretty human readable. It looks a bit like BASIC. Just put the code in the editor and upload it the PICAXE. If everything goes OK, you will be seeing a LED that's blinking short-short-shot-long-long-long-short-short-short.&lt;br /&gt;
&lt;br /&gt;
That's it for now. Till next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-2573980870581809152?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/r2ofR-ZlaCYBoDyGdr1_8GoNXV4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r2ofR-ZlaCYBoDyGdr1_8GoNXV4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/r2ofR-ZlaCYBoDyGdr1_8GoNXV4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r2ofR-ZlaCYBoDyGdr1_8GoNXV4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/AvQRiQ1H924" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/2573980870581809152/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-picaxe.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/2573980870581809152?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/2573980870581809152?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/AvQRiQ1H924/electronic-component-picaxe.html" title="Electronic component: The PICAXE" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/Su84yqJgDyI/AAAAAAAAATo/-lutW7LV0F0/s72-c/picaxeserprogcable.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-picaxe.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8DRn84fyp7ImA9WxNUEUQ.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-9178496703979296177</id><published>2009-11-02T22:54:00.000+01:00</published><updated>2009-11-02T22:54:37.137+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-02T22:54:37.137+01:00</app:edited><title>Electronic component: Light Dependent Resistor (LDR)</title><content type="html">Part of the &lt;a href="http://circuitsforbeginners.blogspot.com/2009/10/project-building-light-meter-1.html"&gt;project &lt;/a&gt;is to find out what a LDR is and does. As the name suggests it has something to do with resistance and with light. Depending on the type the resistance will be lower when more (or less) light falls on the LDR. But you can&amp;nbsp; build the circuit either way.&lt;br /&gt;
&lt;br /&gt;
Today's shopping list contains:&lt;br /&gt;
1 x LDR&lt;br /&gt;
1 x 10 kOhm Potentiometer &lt;br /&gt;
2 x 330 Ohm resistor&lt;br /&gt;
1 transistor BC547B&lt;br /&gt;
1 x green LED&lt;br /&gt;
1 x 9V battery&lt;br /&gt;
&lt;br /&gt;
The following circuit will light a green LED when there is little light. By adjusting the potentiometer you can control the amount of light required.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Su9UcqGcVvI/AAAAAAAAAUg/4tDLAzrABbA/s1600-h/circuit_ldr_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Su9UcqGcVvI/AAAAAAAAAUg/4tDLAzrABbA/s320/circuit_ldr_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;This works basically because when the LDR recieves a lot of light, the resistance will drop. The current will not go through the transistor. As the amount of light drops, the resistance of the LDR will decrease. After a certain point, the current will prefer the transistor instead of the LDR, enabling the green light.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Su9VF8H-PYI/AAAAAAAAAUo/TWq2oPXWSag/s1600-h/circuit_ldr_2_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Su9VF8H-PYI/AAAAAAAAAUo/TWq2oPXWSag/s320/circuit_ldr_2_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-9178496703979296177?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nAl-PUzgPBZKsoZcD7FVkSBoUmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAl-PUzgPBZKsoZcD7FVkSBoUmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nAl-PUzgPBZKsoZcD7FVkSBoUmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAl-PUzgPBZKsoZcD7FVkSBoUmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/yiJDMSXf5V4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/9178496703979296177/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-light-dependent.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/9178496703979296177?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/9178496703979296177?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/yiJDMSXf5V4/electronic-component-light-dependent.html" title="Electronic component: Light Dependent Resistor (LDR)" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/Su9UcqGcVvI/AAAAAAAAAUg/4tDLAzrABbA/s72-c/circuit_ldr_2.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/11/electronic-component-light-dependent.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBR3o7cSp7ImA9WxNUEEw.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-3399655933679990672</id><published>2009-10-31T19:19:00.000+01:00</published><updated>2009-10-31T19:19:16.409+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-31T19:19:16.409+01:00</app:edited><title>Project: Building a light meter (1)</title><content type="html">This is the first project I have started. Nothing to fancy, but something fun to do. Goal is to build a light meter, which measures the amount of light in the environment. It outputs the amount of light by lighting LEDs. The more light, the more LEDs will be lit. We will measure the amount of light with a LDR component.&lt;br /&gt;
&lt;br /&gt;
The key component will be the PICAXE. This is a programmable IC (PIC) for low-end purposes. During the project we will be learning:&lt;br /&gt;
&lt;br /&gt;
- How to use a LDR component&lt;br /&gt;
- How to program a PICAXE&lt;br /&gt;
- How to build the light meter&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Sux_mkL6ZPI/AAAAAAAAATg/lC8xVngPcM4/s1600-h/lightmeter.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Sux_mkL6ZPI/AAAAAAAAATg/lC8xVngPcM4/s320/lightmeter.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-3399655933679990672?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/y2Fq_Zx5Mmu4sGduiGU6_Tssxzg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y2Fq_Zx5Mmu4sGduiGU6_Tssxzg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/y2Fq_Zx5Mmu4sGduiGU6_Tssxzg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y2Fq_Zx5Mmu4sGduiGU6_Tssxzg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/WktsnLk1SHM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/3399655933679990672/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/project-building-light-meter-1.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3399655933679990672?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/3399655933679990672?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/WktsnLk1SHM/project-building-light-meter-1.html" title="Project: Building a light meter (1)" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_t8-2yspE-3E/Sux_mkL6ZPI/AAAAAAAAATg/lC8xVngPcM4/s72-c/lightmeter.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/project-building-light-meter-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUGQHg_eSp7ImA9WxNVGU8.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-8736133755597139294</id><published>2009-10-30T17:30:00.000+01:00</published><updated>2009-10-30T17:30:21.641+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-30T17:30:21.641+01:00</app:edited><title>Circuit basics: Resistance (2)</title><content type="html">Last time I blogged about resistance. Today we are going to look at resistance within a circuit. Everything has basically to do with Ohm's Law, which states states: &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;the current through a conductor between two points is directly proportional to the potential difference or voltage across the two points, and inversely proportional to the resistance between them. (http://en.wikipedia.org/wiki/Ohm%27s_law)&lt;/blockquote&gt;This means that you can calculate the current if you know the voltage and the resistance. Also true is that you can calculate the voltage if you know the current and the resistance, and finally the resistance if you know the current and the voltage.&lt;br /&gt;
&lt;br /&gt;
The formula for Ohm's law is: U = I x R, where U is voltage (in Volts), I is current (in Ampere) and R is resistance (in Ohm). You can also write this as I = U / R or R = U / I.&lt;br /&gt;
&lt;br /&gt;
Given the following circuit:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SusOu7yZo_I/AAAAAAAAASw/_jpIYxzbaGo/s1600-h/circuit_resistance_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SusOu7yZo_I/AAAAAAAAASw/_jpIYxzbaGo/s320/circuit_resistance_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Here we have the three variables:&amp;nbsp; U = 9 Volts, R= 450 Ohm and I = 0.020 Ampere (0.020 A = 20 mA). Let's check:&lt;br /&gt;
&lt;br /&gt;
I x R = U&lt;br /&gt;
0.020 x 450 = 9 Volts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ok, here are some circuits, which value is the missing variable? Rhe answers are at the bottom.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SusP9T38ztI/AAAAAAAAAS4/eICb6KgDFSA/s1600-h/circuit_resistance_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SusP9T38ztI/AAAAAAAAAS4/eICb6KgDFSA/s320/circuit_resistance_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;1. Given: U = 9, I = 0.0257. What is R?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SusQ1_zFw7I/AAAAAAAAATA/ZCW_hFg43eg/s1600-h/circuit_resistance_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SusQ1_zFw7I/AAAAAAAAATA/ZCW_hFg43eg/s320/circuit_resistance_3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;2. Given: R= 350, I = 0.0143. What is U?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SusReBzFH0I/AAAAAAAAATI/-XFl_deSc0A/s1600-h/circuit_resistance_4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SusReBzFH0I/AAAAAAAAATI/-XFl_deSc0A/s320/circuit_resistance_4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
3. Given: U = 9, R=650. What is I? &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SusR7zEq7WI/AAAAAAAAATQ/YKTD0R9gnUU/s1600-h/circuit_resistance_5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SusR7zEq7WI/AAAAAAAAATQ/YKTD0R9gnUU/s320/circuit_resistance_5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
4. How much resistance does the LED generate?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SusSwCfkPzI/AAAAAAAAATY/bt0QDVrXDwQ/s1600-h/circuit_resistance_6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SusSwCfkPzI/AAAAAAAAATY/bt0QDVrXDwQ/s320/circuit_resistance_6.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;5. This circuit has a current of 23.6 mA. How much Ohm is the resistance of the resistor?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. 9 / 0.0257 = 350 Ohm&lt;br /&gt;
2. 350 x 0.0143 = 5 Volts&lt;br /&gt;
3. 9 / 650 = 13.8&amp;nbsp; mA = 0.014 A&lt;br /&gt;
4. 1.9 / 0.0103 = &amp;nbsp; 184 Ohm&lt;br /&gt;
5. As we have learned, the sum of the components in series is the total voltage. So&amp;nbsp; 9 - 1.92 = 7.08 V.&amp;nbsp; 7.08 / 0.0236 = 300 Ohm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-8736133755597139294?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/elIFF7rrh3LPabr4lIQjKzwUjqA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/elIFF7rrh3LPabr4lIQjKzwUjqA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/elIFF7rrh3LPabr4lIQjKzwUjqA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/elIFF7rrh3LPabr4lIQjKzwUjqA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/jjwOvfb9h90" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/8736133755597139294/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-resistance-2.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/8736133755597139294?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/8736133755597139294?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/jjwOvfb9h90/circuit-basics-resistance-2.html" title="Circuit basics: Resistance (2)" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_t8-2yspE-3E/SusOu7yZo_I/AAAAAAAAASw/_jpIYxzbaGo/s72-c/circuit_resistance_1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-resistance-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQMRnY7eSp7ImA9WxNVFks.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-8173574252042803551</id><published>2009-10-27T18:59:00.000+01:00</published><updated>2009-10-27T18:59:47.801+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-27T18:59:47.801+01:00</app:edited><title>Circuit basics: Resistance</title><content type="html">Last time we discussed the resistor. I promised to do a post on resistance as the resistor is quite useless if you don't know about resistance. So what is resistance? &lt;br /&gt;
&lt;br /&gt;
If you imagine electrical current as a water flow, you can imagine the resistor as narrowing of the pipe as can been seen in the following image. We already learned that voltage can be seen as water pressure. At point A the water pressure could be, for example, 8 Volts. Because of the resistor, the water can not flow freely to point B. The pressure at point B would be lower, let's say 6 Volt. This means that the resistor resists 2 Volts.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SuX3BxuUl_I/AAAAAAAAASg/SwrUaUTlIZg/s1600-h/resistor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SuX3BxuUl_I/AAAAAAAAASg/SwrUaUTlIZg/s320/resistor.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;Basically that's it. It's not very hard to understand resistance, but using it in your circuit is much harder. Next time we investigate resistance using resistors in a circuit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-8173574252042803551?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1DVXAkHpFuKTHkP1gph4pUGtLoI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1DVXAkHpFuKTHkP1gph4pUGtLoI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1DVXAkHpFuKTHkP1gph4pUGtLoI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1DVXAkHpFuKTHkP1gph4pUGtLoI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/CnQAMNpFD_U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/8173574252042803551/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-resistance.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/8173574252042803551?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/8173574252042803551?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/CnQAMNpFD_U/circuit-basics-resistance.html" title="Circuit basics: Resistance" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_t8-2yspE-3E/SuX3BxuUl_I/AAAAAAAAASg/SwrUaUTlIZg/s72-c/resistor.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-resistance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEBQX8_fCp7ImA9WxNVFUU.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-1651908541749905245</id><published>2009-10-26T20:50:00.000+01:00</published><updated>2009-10-26T20:50:50.144+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-26T20:50:50.144+01:00</app:edited><title>Electronic components: The resistor</title><content type="html">Well, I'm back from Barcelona, so it's time for a new post. This time about the electronic component: the resistor. As one of the most common components (you will find one in almost every circuit), you should be familiar with it. As the name implies the resistor has much to do with resistance. Because it's a rather big topic, today I will talk about the resistor, resistance is coming up next.&lt;br /&gt;
&lt;br /&gt;
A resistor can be made of a few materials, depending on it's use. Most common is the  carbon based resistor. A resistor has one big feature: resisting. So how much does it resist? That depends on the materials used. The color bands on the resistor will tell you how much resistance you can expect (with a slight tolerance).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SuX5TXYLzUI/AAAAAAAAASo/onobzeTXz6w/s1600-h/resistor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SuX5TXYLzUI/AAAAAAAAASo/onobzeTXz6w/s320/resistor.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The resistor in the previous image has four color bands: black, red, brown and gold. The first two bands will give you a number. Black is 0, red is 2, together this will be 02. That number is multiplied by the third band x 10. Brown is 1, so 1 x 10 = 10. If we multiply 02 with 10, the result would be 20 Ohm. The fourth band will give you the tolerance. Gold will tell us that the resistor has a tolerance of 5%. In other words, the resistor will have an actual resistance between 19 and 21. This is an example, you will not find any resistor with black as first band. Under normal conditions you will have no problem with the tolerance. I borrowed the following table from http://en.wikipedia.org/wiki/Resistor:&lt;br /&gt;
&lt;br /&gt;
&lt;table class="wikitable" height="489" style="width: 649px;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Color&lt;br /&gt;
&lt;/th&gt; &lt;th&gt;1&lt;sup&gt;st&lt;/sup&gt; band&lt;br /&gt;
&lt;/th&gt; &lt;th&gt;2&lt;sup&gt;nd&lt;/sup&gt; band&lt;br /&gt;
&lt;/th&gt; &lt;th&gt;3&lt;sup&gt;rd&lt;/sup&gt; band (multiplier)&lt;br /&gt;
&lt;/th&gt; &lt;th&gt;4&lt;sup&gt;th&lt;/sup&gt; band (tolerance)&lt;br /&gt;
&lt;/th&gt; &lt;th&gt;Temp. Coefficient&lt;br /&gt;
&lt;/th&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: black none repeat scroll 0% 0%; color: white;"&gt; &lt;td&gt;&lt;span style="color: white;"&gt;Black&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;0&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;0&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;×10&lt;sup&gt;0&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(101, 67, 33) none repeat scroll 0% 0%; color: white;"&gt; &lt;td&gt;&lt;span style="color: white;"&gt;Brown&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;1&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;1&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;×10&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;±1% (F)&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;100 ppm&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(224, 36, 16) none repeat scroll 0% 0%; color: black;"&gt; &lt;td&gt;&lt;span style="color: black;"&gt;Red&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;2&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;2&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;±2% (G)&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;50 ppm&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#ff7f00"&gt; &lt;td&gt;Orange&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;3&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;3&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;3&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;15 ppm&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#ffff00"&gt; &lt;td&gt;Yellow&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;4&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;4&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;4&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;25 ppm&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#228b22"&gt; &lt;td&gt;&lt;span style="color: white;"&gt;Green&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;5&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;5&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;×10&lt;sup&gt;5&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;±0.5% (D)&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(0, 0, 205) none repeat scroll 0% 0%; color: white;"&gt; &lt;td&gt;&lt;span style="color: white;"&gt;Blue&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;6&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;6&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;×10&lt;sup&gt;6&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;±0.25% (C)&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(148, 0, 211) none repeat scroll 0% 0%; color: white;"&gt; &lt;td&gt;&lt;span style="color: white;"&gt;Violet&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;7&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;7&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;×10&lt;sup&gt;7&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;span style="color: white;"&gt;±0.1% (B)&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(128, 128, 128) none repeat scroll 0% 0%; color: white;"&gt; &lt;td&gt;Gray&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;8&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;8&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;8&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;±0.05% (A)&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#ffffff"&gt; &lt;td&gt;White&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;9&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;9&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;9&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#d4af37"&gt; &lt;td&gt;Gold&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;-1&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;±5% (J)&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr bgcolor="#c0c0c0"&gt; &lt;td&gt;Silver&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;×10&lt;sup&gt;-2&lt;/sup&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;±10% (K)&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;None&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;±20% (M)&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
I find it easier to use a resistor calculator site like http://www.samengstrom.com/nxl/3660/4_band_resistor_color_code_page.en.html.&lt;br /&gt;
&lt;br /&gt;
That concludes today's topic, thanks for reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-1651908541749905245?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cqNNkX-1kLqrWivwIKsEVBE2Zuw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cqNNkX-1kLqrWivwIKsEVBE2Zuw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cqNNkX-1kLqrWivwIKsEVBE2Zuw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cqNNkX-1kLqrWivwIKsEVBE2Zuw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/p5l5IrCYG08" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/1651908541749905245/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/electronic-components-resistor.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1651908541749905245?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1651908541749905245?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/p5l5IrCYG08/electronic-components-resistor.html" title="Electronic components: The resistor" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/SuX5TXYLzUI/AAAAAAAAASo/onobzeTXz6w/s72-c/resistor.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/electronic-components-resistor.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAFR3w-eCp7ImA9WxNVFUU.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-1802858653774445513</id><published>2009-10-20T20:43:00.001+02:00</published><updated>2009-10-26T20:51:56.250+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-26T20:51:56.250+01:00</app:edited><title>Electronic components: The NE555 IC as a timer</title><content type="html">Today we are going to build an astable flip-flop using the NE555 IC. IC stands for Integrated Circuit, which is miniaturized circuit (also called chip). The NE555 IC can be used as a timer. It will switch every X time, which makes it possible to do actions every X time. A flip-flop is a circuit that will switch states, in our example two LEDs which in turn go on and off. Astable means that will switch without external influences.&lt;br /&gt;
&lt;br /&gt;
Let's talk a bit about ICs first. As said, IC stands for Integrated Circuit. You can use it by connecting the pins of the IC. You can figure out how to connect them by reading the datasheet. The following image is the NE555. An IC has a X number of pins, numbered anti-clockwise starting with the pin left of the notch or closed to a dot. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/St38ACaJ2SI/AAAAAAAAAR4/lfE8O4K4apE/s1600-h/ic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/St38ACaJ2SI/AAAAAAAAAR4/lfE8O4K4apE/s320/ic.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/St394y5BznI/AAAAAAAAASA/wD-TZ_4piSc/s1600-h/ne555_schem.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/St394y5BznI/AAAAAAAAASA/wD-TZ_4piSc/s320/ne555_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;Note that the schematic symbol differs from the actual pin configuration as can been seen on the left.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on what the pins mean see: http://en.wikipedia.org/wiki/555_timer_IC&lt;br /&gt;
&lt;br /&gt;
The following circuit will put the NE555 to use in oscillator mode.&lt;br /&gt;
1 x 9V power supply&lt;br /&gt;
2 x 680 Ohm resistor (blue gray brown gold)&lt;br /&gt;
1 x 1 KOhm resistor (brown black red gold)&amp;nbsp; &lt;br /&gt;
1 x 10 KOhm resistor (brown black orange gold)&lt;br /&gt;
1 x Elco 35v 100 uF&lt;br /&gt;
1 x NE 555 IC&lt;br /&gt;
1 x red LED&lt;br /&gt;
1 x green LED&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/St4ARQc0XZI/AAAAAAAAASI/Nuosdj7bIMo/s1600-h/circuit_ne555_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/St4ARQc0XZI/AAAAAAAAASI/Nuosdj7bIMo/s320/circuit_ne555_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The Elco is a component which I will talk about later. For now it's enough to know it can store a certain amount of energy. The Elco will need to charge. While doing that, the red LED will be on. Upon the moment the energy stored in the Elco crosses 2/3 of the voltage put on pin 8 of the IC (in our case 6 V), the NE 555 will switch, discharging the Elco. This result in the green LED being lit. This continues until the voltage drops to 1/3 (3 volt in our case), in which case the charging starts and the red LED lights up again.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/St4EOObCoyI/AAAAAAAAASY/WDIaPBR_y8M/s1600-h/circuit_ne555_1_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/St4EOObCoyI/AAAAAAAAASY/WDIaPBR_y8M/s320/circuit_ne555_1_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;This is the end result, although I have to admit I blew a LED. Be careful when you are debugging the circuit, the Elco may contain voltages way more than&amp;nbsp; the LED can handle.&lt;br /&gt;
&lt;br /&gt;
That's it for now. I'm on holiday for a few days, so expect new postings next week.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-1802858653774445513?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zhk1H4qfoY1tf6KjSZkyMDIdPng/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zhk1H4qfoY1tf6KjSZkyMDIdPng/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zhk1H4qfoY1tf6KjSZkyMDIdPng/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zhk1H4qfoY1tf6KjSZkyMDIdPng/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/ufTgE-BddLg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/1802858653774445513/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/electric-components-ne555-ic-as-timer.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1802858653774445513?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1802858653774445513?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/ufTgE-BddLg/electric-components-ne555-ic-as-timer.html" title="Electronic components: The NE555 IC as a timer" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_t8-2yspE-3E/St38ACaJ2SI/AAAAAAAAAR4/lfE8O4K4apE/s72-c/ic.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/electric-components-ne555-ic-as-timer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MFQ3czcCp7ImA9WxNWGUo.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-795696525010994839</id><published>2009-10-19T21:10:00.000+02:00</published><updated>2009-10-19T21:10:12.988+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-19T21:10:12.988+02:00</app:edited><title>Circuit basics: Voltage</title><content type="html">Almost everyone knows voltage as something that's coming from the socket in the wall. But what does it do exactly?&lt;br /&gt;
&lt;br /&gt;
Voltage is the difference in electronical potential between two points. For example a battery has two point, the + and the - poles.&amp;nbsp; You can imagine electronical potential as a large water tank under pressure. The amount of 'pressure' is measured in volts. The + pole is at full pressure (1.5V for example) the - pole is at zero pressure. Upon connecting the two tanks, water will flow between the tanks which is the current. When the pressure in tank + and tank - is equal, water will no longer flow between them.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Sty5B6d-ywI/AAAAAAAAARw/zUmlBQJF7tU/s1600-h/water.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Sty5B6d-ywI/AAAAAAAAARw/zUmlBQJF7tU/s320/water.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Within our circuits the battery (or power supply) is delivering the voltage. In the following circuit a battery is connected to a voltmeter:&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
1 x Multimeter&lt;br /&gt;
1 x 3V power supply&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StyRzVNjSqI/AAAAAAAAAQw/pCUBcl6zufo/s1600-h/circuit_voltage_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StyRzVNjSqI/AAAAAAAAAQw/pCUBcl6zufo/s320/circuit_voltage_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The volt meter should read the voltage between te + and - pole of the battery. Let's see how this works out in real situation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/StyeJsJlnlI/AAAAAAAAAQ4/KuRHr3hq2hw/s1600-h/circuit_voltage_1_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/StyeJsJlnlI/AAAAAAAAAQ4/KuRHr3hq2hw/s320/circuit_voltage_1_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;As you can see, the volt meter read 2.9 volts. This is because the battery is not delivering the promised 3V and the volt meter has a tolerance of about 1-2%. In practice this doesn't really matter, as most electronic component have a tolerance too.&lt;br /&gt;
&lt;br /&gt;
Next we'll see what happens when components are put in series:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1 x Multimeter&lt;br /&gt;
1 x 3V power supply&lt;br /&gt;
1 x 150 Ohm resistor (brown green brown gold) &lt;br /&gt;
1 x Red LED &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/StykwEn5lQI/AAAAAAAAARA/MttxTLApGdo/s1600-h/circuit_voltage_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/StykwEn5lQI/AAAAAAAAARA/MttxTLApGdo/s320/circuit_voltage_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/StypHBAumTI/AAAAAAAAARI/WrpH0gwu8no/s1600-h/circuit_voltage_2_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/StypHBAumTI/AAAAAAAAARI/WrpH0gwu8no/s320/circuit_voltage_2_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
The resistor and LED are put in series. Also three volt meters are shown. You will notice that the sum of the two voltmeters put in series is equal to the volt meter on the right. This means that sum of the voltage over each component put in series is equal to the voltage of the power source. So how is it possible that the LED has a different voltage than the resistor? That's because of the resistance. I will blog about it later.&lt;br /&gt;
&lt;br /&gt;
Finally a circuit where two LED's are put in parallel:&lt;br /&gt;
&lt;br /&gt;
1 x Multimeter&lt;br /&gt;
1 x 3V power supply&lt;br /&gt;
1 x 150 Ohm resistor (brown green brown gold) &lt;br /&gt;
2 x Red LED &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StyuNykxzKI/AAAAAAAAARo/LT0soP0ExJo/s1600-h/circuit_voltage_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StyuNykxzKI/AAAAAAAAARo/LT0soP0ExJo/s320/circuit_voltage_3.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Stys2FlsN8I/AAAAAAAAARg/qhnRrpR2YfE/s1600-h/circuit_voltage_3_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Stys2FlsN8I/AAAAAAAAARg/qhnRrpR2YfE/s320/circuit_voltage_3_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
As you can see, the voltage over both LEDs is equal. This means that components in parallel have the same voltage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-795696525010994839?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8T8eYi7HqmsZODTgX42CLlCO2ZY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8T8eYi7HqmsZODTgX42CLlCO2ZY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8T8eYi7HqmsZODTgX42CLlCO2ZY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8T8eYi7HqmsZODTgX42CLlCO2ZY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/8JD63WdiOA8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/795696525010994839/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-voltage.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/795696525010994839?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/795696525010994839?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/8JD63WdiOA8/circuit-basics-voltage.html" title="Circuit basics: Voltage" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_t8-2yspE-3E/Sty5B6d-ywI/AAAAAAAAARw/zUmlBQJF7tU/s72-c/water.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/circuit-basics-voltage.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEADQ3c7fip7ImA9WxNWGEo.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-514035641295291393</id><published>2009-10-18T16:39:00.000+02:00</published><updated>2009-10-18T16:39:32.906+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-18T16:39:32.906+02:00</app:edited><title>Electronic components: the transistor as a switch</title><content type="html">As one of the most important inventions in the field of electronics, the transistor today is found in almost any device. Basically the transistor can be used as a switch or as an amplifier. Today we will investigate the first function: the switch.&lt;br /&gt;
&lt;br /&gt;
There are a few types of transistors, but I will use only the C547B. You should be able to find this transistor (or similar) at any electronics shop. Or you might find a few in a electronic device you want to get rid of.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/StsK82LlqlI/AAAAAAAAAPQ/ydZ-95WsT6k/s1600-h/transistor_schem2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/StsK82LlqlI/AAAAAAAAAPQ/ydZ-95WsT6k/s320/transistor_schem2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The transistor has three terminals: base (b), collector (c) and the emitter (e). If you put current on the base, a current will flow from collector to emitter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following circuits will demonstrate the use of the transistor as a switch. Refer to the list of electronic components in one of my other blog posts for the meaning of the symbols used. The first circuit will light a LED when the button is pressed. The following components are required to build the circuit:&lt;br /&gt;
&lt;br /&gt;
1 x 150 Ohm resistor (brown green brown gold)&lt;br /&gt;
1 x 1k Ohm resistor (brown black red gold)&lt;br /&gt;
1 x C547B transistor&lt;br /&gt;
1 x 3V power supply&lt;br /&gt;
1 x Red LED &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsgxW24T_I/AAAAAAAAAQI/PMXlWtXD3vY/s1600-h/circuit_transistor_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsgxW24T_I/AAAAAAAAAQI/PMXlWtXD3vY/s320/circuit_transistor_1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;As shown, the LED is placed in series with the 150 Ohm resistor and transistor. Also the transistor is placed in series with a 1KOhm resistor en button. Both resistors protect the LED and transistor. When the button is pressed a current will flow into the transistor, enabling the LED. Note that the current flowing trough the LED is much higher then the current trough the button.&amp;nbsp; This is one of the advantages of the transistor. The end result would look like this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/StskgSypWLI/AAAAAAAAAQQ/w8orcCCZMTQ/s1600-h/circuit_transistor_1_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/StskgSypWLI/AAAAAAAAAQQ/w8orcCCZMTQ/s320/circuit_transistor_1_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now as a bonus I will show another example. We'll take the same circuit, but add another LED (green). When the button is up this LED will light up, when the button is down it will go off. The result is that either the red LED is on, when the button is pressed, or the green LED is on.&amp;nbsp; The shopping list for this circuit would be:&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
2 x 150 Ohm resistor (brown green brown gold)&lt;br /&gt;
1 x 1k Ohm resistor (brown black red gold)&lt;br /&gt;
2 x C547B transistor&lt;br /&gt;
1 x 3V power supply&lt;br /&gt;
1 x Red LED&lt;br /&gt;
1 x Green LED &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsmT_AybhI/AAAAAAAAAQg/TDoeiG6dWkM/s1600-h/circuit_transistor_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsmT_AybhI/AAAAAAAAAQg/TDoeiG6dWkM/s320/circuit_transistor_2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I have placed the second transistor in parallel to the first transistor. The green LED is then placed in parallel to the transistor. That way the transistor will work as a NOT logic segment: when no current is placed on the transistor the LED will light up, otherwise it will go off.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/StsoEDp2dII/AAAAAAAAAQo/V9ivec7ApQc/s1600-h/circuit_transistor_2_result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/StsoEDp2dII/AAAAAAAAAQo/V9ivec7ApQc/s320/circuit_transistor_2_result.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Well that's it for today, thanks for reading. &lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-514035641295291393?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yXdkhW8Bee6zI-J20Waj7jPH84U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yXdkhW8Bee6zI-J20Waj7jPH84U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yXdkhW8Bee6zI-J20Waj7jPH84U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yXdkhW8Bee6zI-J20Waj7jPH84U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/YdVVsggHBNU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/514035641295291393/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/electronic-components-transistor-as.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/514035641295291393?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/514035641295291393?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/YdVVsggHBNU/electronic-components-transistor-as.html" title="Electronic components: the transistor as a switch" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_t8-2yspE-3E/StsK82LlqlI/AAAAAAAAAPQ/ydZ-95WsT6k/s72-c/transistor_schem2.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/electronic-components-transistor-as.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYHRXs_eip7ImA9WxNUE0o.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-7676292785819091492</id><published>2009-10-17T19:00:00.003+02:00</published><updated>2009-11-04T22:28:54.542+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-04T22:28:54.542+01:00</app:edited><title /><content type="html">This is a list of components I've used. I'll only put a picture, the schematic symbol (if appropriate) and a really short description. In later blog postings I'll explain them more in detail. But I wanted to have a list I can refer to from other postings. This post will therefore be updated regularly.&amp;nbsp; &lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Batteryholder with two AA batteries (3V)  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Sti_Thu1WbI/AAAAAAAAANo/zmdbPAz6LWQ/s1600-h/3v3batpack.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393270895969393074" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Sti_Thu1WbI/AAAAAAAAANo/zmdbPAz6LWQ/s320/3v3batpack.JPG" style="cursor: pointer; float: left; height: 214px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;This is a holder for two AA batteries. As one AA battery is 1.5V, the two batteries will deliver 3V. This is enough to power basic circuits.&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsNw-JeiLI/AAAAAAAAAPY/2fFwWORFmoI/s1600-h/3v3batpack_schem.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsNw-JeiLI/AAAAAAAAAPY/2fFwWORFmoI/s320/3v3batpack_schem.JPG" style="cursor: move;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th colspan="2"&gt;Battery connector  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/StluoeZFYLI/AAAAAAAAANw/EuOMJFO9lPM/s1600-h/batpackconnector.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393463670384976050" src="http://2.bp.blogspot.com/_t8-2yspE-3E/StluoeZFYLI/AAAAAAAAANw/EuOMJFO9lPM/s320/batpackconnector.JPG" style="cursor: pointer; float: left; height: 249px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;A battery connector makes it easy for you to power your circuit. The connector is useful in combination with a battery holder or a 9V battery.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Resistor  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/StlwTBItodI/AAAAAAAAAN4/azYBEFiw3g4/s1600-h/resistor.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393465500777685458" src="http://1.bp.blogspot.com/_t8-2yspE-3E/StlwTBItodI/AAAAAAAAAN4/azYBEFiw3g4/s320/resistor.JPG" style="cursor: pointer; float: left; height: 221px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;This is one of the most common electronic components. It does basically what it's name says: resisting. This component enables you to lower the voltage on other components placed in series with the resistor.&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsOVnTPLII/AAAAAAAAAPo/esGEIJMhZ3k/s1600-h/resistor_schem.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsOVnTPLII/AAAAAAAAAPo/esGEIJMhZ3k/s320/resistor_schem.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Light Emitting Diode (LED)  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/Stly0ApcMZI/AAAAAAAAAOA/hYO_iedcBlg/s1600-h/Led.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393468266605457810" src="http://4.bp.blogspot.com/_t8-2yspE-3E/Stly0ApcMZI/AAAAAAAAAOA/hYO_iedcBlg/s320/Led.JPG" style="cursor: pointer; float: left; height: 251px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Also a very common component within a circuit. And a must have for anyone starting to learn electronics. As it's a cheap component you will probably break one or two in the proces. As it's name says it's a diode (see below) that emits light.&lt;br /&gt;
&lt;/td&gt;  &lt;td&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/StsORp7tEqI/AAAAAAAAAPg/jjh4UrHBREY/s1600-h/Led_schem.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/StsORp7tEqI/AAAAAAAAAPg/jjh4UrHBREY/s320/Led_schem.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Diode  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Stlzr0tX88I/AAAAAAAAAOI/k7dD3Nz1ExA/s1600-h/Diode.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393469225473405890" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Stlzr0tX88I/AAAAAAAAAOI/k7dD3Nz1ExA/s320/Diode.JPG" style="cursor: pointer; float: left; height: 171px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;A component used in the more advanced circuits is the diode. It has one purpose: to make a wire one-way traffic.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Electrolytic capacitor  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Stl0nxS-IkI/AAAAAAAAAOQ/3r7wsrgmvko/s1600-h/Elco.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393470255349506626" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Stl0nxS-IkI/AAAAAAAAAOQ/3r7wsrgmvko/s320/Elco.JPG" style="cursor: pointer; float: left; height: 261px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Not really a basic component, but much used. For now I'll stick to the description that it will stores energy and is able to release it quickly.&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHx6_RS7YI/AAAAAAAAAV4/bNgZG8RzV5U/s1600-h/elco_schem.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHx6_RS7YI/AAAAAAAAAV4/bNgZG8RzV5U/s320/elco_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;potentiometer  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/Stl2N-xkioI/AAAAAAAAAOY/wOhsBKtdGUs/s1600-h/Potmeter.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393472011314170498" src="http://3.bp.blogspot.com/_t8-2yspE-3E/Stl2N-xkioI/AAAAAAAAAOY/wOhsBKtdGUs/s320/Potmeter.JPG" style="cursor: pointer; float: left; height: 288px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Handy component, especially for beginners. It enables you to adjust the resistance manually.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Transistor  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Stl30UFF8bI/AAAAAAAAAOg/OmMHOYVyXng/s1600-h/Transistor.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393473769379852722" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Stl30UFF8bI/AAAAAAAAAOg/OmMHOYVyXng/s320/Transistor.JPG" style="cursor: pointer; float: left; height: 226px; margin: 0pt 10px 10px 0pt; width: 246px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;The component that made everything else possible. It's function is easy to understand, but very useful. It's basically a button you can press by putting current on the middle connector.&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/StsQeWR-J9I/AAAAAAAAAQA/EAL41v-3S54/s1600-h/transistor_schem.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/StsQeWR-J9I/AAAAAAAAAQA/EAL41v-3S54/s320/transistor_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;NE555  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/Stl54StgQRI/AAAAAAAAAOo/U10xwkC-VbI/s1600-h/IC+555.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393476036755210514" src="http://1.bp.blogspot.com/_t8-2yspE-3E/Stl54StgQRI/AAAAAAAAAOo/U10xwkC-VbI/s320/IC+555.JPG" style="cursor: pointer; float: left; height: 220px; margin: 0pt 10px 10px 0pt; width: 250px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Basic integrated circuit (IC) that can be used as a timer.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Multimeter  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/Stl6r6sLYUI/AAAAAAAAAOw/ZkqmA9iuY_I/s1600-h/multimeter.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5393476923660394818" src="http://2.bp.blogspot.com/_t8-2yspE-3E/Stl6r6sLYUI/AAAAAAAAAOw/ZkqmA9iuY_I/s320/multimeter.JPG" style="cursor: pointer; float: left; height: 222px; margin: 0pt 10px 10px 0pt; width: 320px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Also a must have for anyone learning electronics: the multimeter. Although you can build circuits without it, it will help you very much to understand things and debug your circuit.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Breadbord  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/StsA9Cc0UvI/AAAAAAAAAPA/YT_DVTz-1RI/s1600-h/breadbord.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/StsA9Cc0UvI/AAAAAAAAAPA/YT_DVTz-1RI/s320/breadbord.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Another must have for beginners is the breadbord. It will allow you to build circuits without soldering. No mess and infinite retries.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Press button  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsQSLVljaI/AAAAAAAAAP4/ud0oHylP218/s1600-h/pressbutton.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsQSLVljaI/AAAAAAAAAP4/ud0oHylP218/s320/pressbutton.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt; &lt;td&gt;This is a pretty straightforward component. If you press the button a current will flow through it. Upon release the flow is broken.&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/StsOYSco1sI/AAAAAAAAAPw/Jdy_Ejow4Y0/s1600-h/pressbutton_schem.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/StsOYSco1sI/AAAAAAAAAPw/Jdy_Ejow4Y0/s320/pressbutton_schem.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Light Dependent Resistor (LDR)  &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SvHrZ23968I/AAAAAAAAAUw/pQcncJHcgek/s1600-h/LDR.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SvHrZ23968I/AAAAAAAAAUw/pQcncJHcgek/s320/LDR.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt; &lt;td&gt;This component will enable you to detect the amount of light. The more light, the less resistance it will generate.&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHsH_4rvHI/AAAAAAAAAU4/0pAddqM_jhE/s1600-h/LDR_schem.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHsH_4rvHI/AAAAAAAAAU4/0pAddqM_jhE/s320/LDR_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Crystal oscillator &lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHtPWFgVZI/AAAAAAAAAVA/3zH_eh8oJDo/s1600-h/crystal.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHtPWFgVZI/AAAAAAAAAVA/3zH_eh8oJDo/s320/crystal.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;A Crystal will generate a electrical signal with a very precise frequency. &lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHtUd49UwI/AAAAAAAAAVI/p4lXect3jEU/s1600-h/crystal_schem.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHtUd49UwI/AAAAAAAAAVI/p4lXect3jEU/s320/crystal_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Atmega328&lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHwqWWtU7I/AAAAAAAAAVQ/AkgsIU-zhtQ/s1600-h/atmel328.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_t8-2yspE-3E/SvHwqWWtU7I/AAAAAAAAAVQ/AkgsIU-zhtQ/s320/atmel328.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;The Atmega328 is a PIC which is also used on the Arduino. &lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Ceramic capacitor&lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SvHwwhPlDyI/AAAAAAAAAVY/gNiw9a0TmP0/s1600-h/capacitator.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SvHwwhPlDyI/AAAAAAAAAVY/gNiw9a0TmP0/s320/capacitator.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Like the electrolytic capacitor, it stores energy for a short period of time. These are better suited for high frequencies.&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_t8-2yspE-3E/SvHxHIMIN9I/AAAAAAAAAVw/xjRmEKtwMEU/s1600-h/capacitator.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_t8-2yspE-3E/SvHxHIMIN9I/AAAAAAAAAVw/xjRmEKtwMEU/s320/capacitator.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th colspan="2"&gt;Voltage regulator&lt;br /&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_t8-2yspE-3E/SvHwzxJ4-7I/AAAAAAAAAVg/MxxVgyhTBoU/s1600-h/power_regulator.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_t8-2yspE-3E/SvHwzxJ4-7I/AAAAAAAAAVg/MxxVgyhTBoU/s320/power_regulator.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;Component that keeps the voltage stable.&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHw3wXazAI/AAAAAAAAAVo/ufLxvyYOHUU/s1600-h/power_regulator_schem.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_t8-2yspE-3E/SvHw3wXazAI/AAAAAAAAAVo/ufLxvyYOHUU/s320/power_regulator_schem.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-7676292785819091492?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3MA-EArpe_1CL0T14aro-ohRco4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3MA-EArpe_1CL0T14aro-ohRco4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3MA-EArpe_1CL0T14aro-ohRco4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3MA-EArpe_1CL0T14aro-ohRco4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/d3xDw0bCj0A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/7676292785819091492/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/this-is-list-of-components-ive-used.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/7676292785819091492?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/7676292785819091492?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/d3xDw0bCj0A/this-is-list-of-components-ive-used.html" title="" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_t8-2yspE-3E/Sti_Thu1WbI/AAAAAAAAANo/zmdbPAz6LWQ/s72-c/3v3batpack.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/this-is-list-of-components-ive-used.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEDR3w4eyp7ImA9WxNWF0s.&quot;"><id>tag:blogger.com,1999:blog-2479467600094354675.post-1039448798802168906</id><published>2009-10-16T19:08:00.000+02:00</published><updated>2009-10-17T10:21:16.233+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-17T10:21:16.233+02:00</app:edited><title>Welcome</title><content type="html">Hi, thanks for visiting my blog. I am Bart and I'll be blogging about electronics here. I live in Holland and work for a midsize company, doing IT related stuff. As I just have started this as a hobby (I've been doing this only a few weeks), I wanted to share my experiences. The only knowledge about electronics I've gathered by trying, although I have been thought about it at school. Which has been a long time ago.&lt;br/&gt;&lt;br/&gt;What I have in mind for this blog is posting on subjects I've been investigating. The first days  I'll try to cover my experiences from the past few weeks. Each posting will handle a subject, most likely some circuit I've been testing. I will use Yenka (www.yenka.com) as tool to draw the schematics. Basically because it's free for personal use, and quite easy to use. Also it has a lot of demo circuits you might be interested in to build yourself. It even has some degree of simulating what will explode if you do it wrong. Also I'll be using my camera to capture the end result.  That's it for now, see you later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2479467600094354675-1039448798802168906?l=circuitsforbeginners.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ExOJlT91rcmrPptGbl3VvLbIgtc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExOJlT91rcmrPptGbl3VvLbIgtc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ExOJlT91rcmrPptGbl3VvLbIgtc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExOJlT91rcmrPptGbl3VvLbIgtc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CircuitsForBeginners/~4/FlxPYxnMMXA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://circuitsforbeginners.blogspot.com/feeds/1039448798802168906/comments/default" title="Reacties plaatsen" /><link rel="replies" type="text/html" href="http://circuitsforbeginners.blogspot.com/2009/10/welcome.html#comment-form" title="0 reacties" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1039448798802168906?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2479467600094354675/posts/default/1039448798802168906?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CircuitsForBeginners/~3/FlxPYxnMMXA/welcome.html" title="Welcome" /><author><name>Bart</name><uri>http://www.blogger.com/profile/05727129138357870457</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://circuitsforbeginners.blogspot.com/2009/10/welcome.html</feedburner:origLink></entry></feed>

