<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cylindric&#039;s Words</title>
	<atom:link href="http://www.cylindric.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cylindric.net/blog</link>
	<description>Just another blog</description>
	<lastBuildDate>Wed, 01 Feb 2012 14:50:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building the Rodentometer &#8211; Part 2: The Hardware</title>
		<link>http://www.cylindric.net/blog/2012/02/building-the-rodentometer-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=building-the-rodentometer-2</link>
		<comments>http://www.cylindric.net/blog/2012/02/building-the-rodentometer-2/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 13:49:36 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Rodentometer]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[rodentometer]]></category>

		<guid isPermaLink="false">http://www.cylindric.net/blog/?p=53</guid>
		<description><![CDATA[The Input (This is Part Two in an ongoing series which starts at Part One). To answer all the questions raised in part one, there is only one thing we really need to know: How far does our hamster run in &#8230;<p class="read-more"><a href="http://www.cylindric.net/blog/2012/02/building-the-rodentometer-2/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h1>The Input</h1>
<p><em>(This is Part Two in an ongoing series which starts at <a title="Building The Rodentometer – Part 1: An Introduction" href="http://www.cylindric.net/blog/2012/01/building-the-rodentometer-1/">Part One</a>).</em></p>
<p><img class="alignleft size-thumbnail wp-image-49" title="Rotastak Hamster Wheel" src="http://www.cylindric.net/blog/wp-content/uploads/rotastak-150x150.jpg" alt="" width="150" height="150" />To answer all the questions raised in part one, there is only one thing we really need to know:</p>
<blockquote><p>How far does our hamster run in a particular period of time?</p></blockquote>
<p>The &#8220;how far&#8221; part should be quite easy, because the little critter is running in a fixed wheel &#8211; no need for a micro-GPS tracking bug here.  Some mechanism for counting how many times the wheel turns should be sufficient.</p>
<p>So, how can we measure the rotations of a wheel like this?  Well there are several ways, but the one I&#8217;ve gone for to start with, due both to the simplicity and the fact that I have the parts on-hand, is the <a title="Wikipedia - Reed switch" href="http://en.wikipedia.org/wiki/Reed_switch" target="_blank">reed switch</a>.<span id="more-53"></span></p>
<h2>The Humble Reed Switch</h2>
<p>A reed switch is a simple device.  It&#8217;s essentially just two bits of metal in a sealed glass tube, and the ends overlap slightly but don&#8217;t <em>quite</em> touch &#8211; the switch is open.  If you wave a magnet around near them though, they magnetise and stick together.  CLICK &#8211; switch closed.</p>
<p><img class="aligncenter size-medium wp-image-62" title="Reed Switch" src="http://www.cylindric.net/blog/wp-content/uploads/reed_switch-300x69.jpg" alt="" width="300" height="69" /></p>
<p>What this means is that we don&#8217;t need to have any direct mechanical contact between the stationary Rodentometer and the spinning wheel.  We can attach the reed switch to the edge of the back part of the wheel (the bit that&#8217;s not spinning) and glue a little magnet to the spinning part of the wheel.  Every time the wheel turns, the magnet will pass near the switch and momentarily close it.  Those little &#8220;ticks&#8221; of the switch is what we will count &#8211; each tick is another 54cm travelled.</p>
<h2>The Similarly Humble Push Button</h2>
<p><a href="http://www.cylindric.net/blog/wp-content/uploads/mini_push_to_make.jpg"><img class="aligncenter size-full wp-image-78" title="Miniature Push-To-Make Switch" src="http://www.cylindric.net/blog/wp-content/uploads/mini_push_to_make.jpg" alt="" width="224" height="140" /></a></p>
<p>A little switch on the project will allow for easy resetting of the statistics, without the vulgar resort of just pulling the plug. I used ones very similar to those pictured above, but really any sort of simple push-to-make switch will do.</p>
<h1>The Brains</h1>
<p>As already mentioned in <a title="Building the Rodentometer – Part 1: An Introduction" href="http://www.cylindric.net/blog/2012/01/building-the-rodentometer-an-introduction/">Part One</a>, the brains of the operation will be an <a title="Arduino Uno" href="http://arduino.cc/en/Main/arduinoBoardUno" target="_blank">Arduino Uno</a>, featuring the <em>ATmega328</em> microprocessor. This will handle all the input sensing, the distance and timing calculations and finally some sort of output.<img class="aligncenter size-thumbnail wp-image-40" title="Arduino Uno" src="http://www.cylindric.net/blog/wp-content/uploads/arduino_uno_256-150x150.jpg" alt="The Arduino Uno" width="150" height="150" /></p>
<h1>The Output</h1>
<p>It&#8217;s all well and good for the Arduino to know how many revolutions of the wheel there have been, or that the hamster has run for 93km since the weekend, but how are <em>we</em> going to find out?  For that, I&#8217;ve decided on several options, and we&#8217;ll be seeing all three.</p>
<h2>Serial Data</h2>
<p>As long as the Arduino is connected to a computer using the USB, it&#8217;s really easy to talk to it using the Serial port.  In the code, we just make sure we configure the board to &#8220;talk serial&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> setup<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
  Serial.<span style="color: #007788;">begin</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">115200</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>And then whenever we want to send any messages to the computer we can just do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Serial.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The current revolution counter is: &quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
Serial.<span style="color: #007788;">println</span><span style="color: #008000;">&#40;</span>currentCount<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>And then we&#8217;ll see that appear in our Arduino IDE as &#8220;The current revolution counter is: 123&#8243;.</p>
<p>This is basically the main debugging technique for Arduino code &#8211; you can sprinkle the Serial.print commands throughout the code and you can see what it&#8217;s up to in the IDE.</p>
<h2>LCD Display</h2>
<p><img class="alignleft size-full wp-image-69" title="SparkFun Serial GLCD" src="http://www.cylindric.net/blog/wp-content/uploads/sparkfun_serial_glcd_transparent.png" alt="" width="256" height="189" /></p>
<p>The more fancy feedback will come from the SparkFun Graphical LCD, which is a nice little 128&#215;64 pixel display, which when coupled with the &#8220;Serial Backpack&#8221; means you only need two Arduino pins to send it commands.  You can draw all sorts of pretty shapes&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cylindric.net/blog/2012/02/building-the-rodentometer-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building the Rodentometer &#8211; Part 1: An Introduction</title>
		<link>http://www.cylindric.net/blog/2012/01/building-the-rodentometer-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=building-the-rodentometer-1</link>
		<comments>http://www.cylindric.net/blog/2012/01/building-the-rodentometer-1/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 16:42:44 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Rodentometer]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[rodentometer]]></category>

		<guid isPermaLink="false">http://www.cylindric.net/blog/?p=34</guid>
		<description><![CDATA[The Setup (Part One is not going to have anything exciting and technical in it.  If you&#8217;re a geek, and let&#8217;s be honest, why would you be here if not, skip to Part Two). So I live in a house with &#8230;<p class="read-more"><a href="http://www.cylindric.net/blog/2012/01/building-the-rodentometer-1/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h1>The Setup</h1>
<p><a href="http://www.cylindric.net/blog/wp-content/uploads/rotastak.jpg"><img class="size-thumbnail wp-image-49 alignright" title="Rotastak Hamster Wheel" src="http://www.cylindric.net/blog/wp-content/uploads/rotastak-150x150.jpg" alt="" width="150" height="150" /></a><small><em>(Part One is not going to have anything exciting and technical in it.  If you&#8217;re a geek, and let&#8217;s be honest, why would you be here if not, skip to <a title="Building the Rodentometer – Part 2: The Hardware" href="http://www.cylindric.net/blog/2012/02/building-the-rodentometer-2/">Part Two</a>).</em></small></p>
<p><em></em>So I live in a house with a Hamster.  <a title="Hamsters.  Lots of them." href="http://www.google.co.uk/search?tbm=isch&amp;q=hamster" target="_blank">Syrian hamsters</a> are pretty great, as pets go: they are fairly tidy*, fairly quiet*, don&#8217;t need taking for walks* and don&#8217;t poo on the carpets*. The thing about them is, though, that they are <em>active</em>.  During the day they are just fat little lazy potato-shaped furballs, but come evening, like gremlins, the start scurrying, chewing and running about like hopped-up little crazies. The question is &#8211; how far does <em>our</em> hamster run?  Is she an athlete, or a lazy good-for-nothing? Read on to see how I plan to find out&#8230;</p>
<p><span id="more-34"></span></p>
<p>(*most of the time)</p>
<h1>The Question</h1>
<p>Now, about the running.  They love it.  Really. Ours has a little wheel (well two actually), and once she&#8217;s in it, she runs and runs and runs.  I&#8217;ve seen it written (on <a title="Hamster Wheels on Wikipedia" href="http://en.wikipedia.org/wiki/Hamster_wheel" target="_blank">the internet</a>, so it must be true) that in one night they can run up to 9km.  Rats might run 43km in 24 hours.</p>
<p>The questions I really have are:</p>
<ul>
<li>How far does our hamster run in a night?</li>
<li>For how long does she run for every night?</li>
<li>How fast does she run?</li>
<li>What is her maximum speed?</li>
</ul>
<h1>The Solution</h1>
<p><img class="alignleft size-thumbnail wp-image-40" title="Arduino Uno" src="http://www.cylindric.net/blog/wp-content/uploads/arduino_uno_256-150x150.jpg" alt="The Arduino Uno" width="150" height="150" />The answer to my intrigue lies in the formidable <a title="Arduino" href="http://arduino.cc" target="_blank">Arduino</a>. To directly quote their website:</p>
<blockquote><p>Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It&#8217;s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.</p></blockquote>
<p>Basically, you hook up any switches, lights, sensors or other electronics as required to the various input and output pins on the Arduino, and then program it using a simple IDE.  Upload your code to the board using a USB cable, and off you go!</p>
<p>The key thing to know about the Uno is that it has a bunch of pins that you can attach things to, either for input (buttons, switches, sensors, etc) or output (some LEDs perhaps).  Programming is done in C++, in a simple little editor which uploads using a USB cable.  The Arduino IDE has a bunch of nice touches that means you can do simple things like &#8220;digitalRead(PIN)&#8221; to get a reading, instead of weird esoteric operations with registers.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cylindric.net/blog/2012/01/building-the-rodentometer-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A (very) late update to the GLCD debacle</title>
		<link>http://www.cylindric.net/blog/2012/01/a-very-late-update-to-the-glcd-debacle/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-very-late-update-to-the-glcd-debacle</link>
		<comments>http://www.cylindric.net/blog/2012/01/a-very-late-update-to-the-glcd-debacle/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 16:26:38 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://www.cylindric.net/blog/?p=25</guid>
		<description><![CDATA[As I explained in my previous post, back in July I embarked on a journey to try and get a nice new 128&#215;64 pixel graphical LCD display to play nicely with my Arduino projects.  I hit some fairly big problems &#8230;<p class="read-more"><a href="http://www.cylindric.net/blog/2012/01/a-very-late-update-to-the-glcd-debacle/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>As I explained in my previous post, back in July I embarked on a journey to try and get a nice new 128&#215;64 pixel graphical LCD display to play nicely with my <a title="Arduino" href="http://arduino.cc" target="_blank">Arduino</a> projects.  I hit some fairly big problems with this, in areas I maybe didn&#8217;t expect&#8230;<span id="more-25"></span></p>
<h1>The Basics</h1>
<p>So the basics of talking to the SerialGLCD backpack are quite simple.  You just hook it up to the serial transmit pin of the Arduino (pin 2 on an <em>Uno</em>), and then just sent bytes to it.   The general form of the commands is to send the byte 0x7C, which means &#8220;here starts a command&#8221;, and then the command.</p>
<p>Here&#8217;s a simple example that draws a little box in the middle of the screen:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x7C</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// command</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x0F</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// box</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">59</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// X1</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">27</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Y1</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">69</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// X2</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">37</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Y2</span>
Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x01</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Draw</span></pre></div></div>

<h1>The Problem</h1>
<p>Seems simple enough.  But&#8230; and there&#8217;s always a <em>but</em>, the firmware is broken.  So for starters that last parameter (wether to set the rectangle pixels to foreground or background) is totally ignored.  But of course, as any non-command text is printed to the display, it&#8217;s not <em>really</em> ignored, it&#8217;s shown on-screen as garbage.</p>
<p>Another problem, is that if you run a loop or just generally are sending more than one box to the screen, it corrupts.  You&#8217;ll find extra lines, skipped commands, garbage on the screen, and so on.</p>
<h1>The Solution</h1>
<p>The only solution is to accept that the SparkFun firmware is broken, and write your own.  Okay, maybe not write your own, that&#8217;s tricky stuff.  Luckily, a kind individual going by the name of SummoningDark has done this for us, so all we need to do is download his <a title="SerialGLCD Firmware" href="http://sourceforge.net/projects/serialglcd/files/" target="_blank">firmware</a> from his <a title="SerialGLCD" href="http://sourceforge.net/projects/serialglcd/" target="_blank">SourceForge</a> and burn it onto the backpack using an ISP.</p>
<h1>Links</h1>
<ul>
<li>The <a title="Graphic LCD 128x64 STN LED Backlight" href="http://www.sparkfun.com/products/710" target="_blank">Graphic LCD 128&#215;64 STN LED Backlight</a></li>
<li>The <a title="SparkFun Graphic LCD Serial Backpack" href="http://www.sparkfun.com/products/9352" target="_blank">SparkFun Graphic LCD Serial Backpack</a></li>
<li><a title="SerialGLCD" href="http://sourceforge.net/projects/serialglcd/" target="_blank">SummoningDark&#8217;s project page on SourceForge</a></li>
<li>A <a title="Guide: How to use an Arduino as an In System Programmer (ISP)" href="http://arduino.cc/forum/index.php?topic=65099.0" target="_blank">great post on the Arduino forums</a> with step-by-step details on building the ISP</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.cylindric.net/blog/2012/01/a-very-late-update-to-the-glcd-debacle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino and the SparkFun Serial Graphical LCD Backpack</title>
		<link>http://www.cylindric.net/blog/2011/07/arduino-and-the-sparkfun-serial-graphical-lcd-backpack/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arduino-and-the-sparkfun-serial-graphical-lcd-backpack</link>
		<comments>http://www.cylindric.net/blog/2011/07/arduino-and-the-sparkfun-serial-graphical-lcd-backpack/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 11:53:20 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://www.cylindric.net/blog/?p=8</guid>
		<description><![CDATA[I&#8217;m trying my hand at controlling a 128&#215;64 pixel Graphical LCD screen (GLCD) from my little Arduino Uno.  Now, this thing uses the fairly common KS0108B parallel interface, which is great, but requires about 20 pins to control.  In order &#8230;<p class="read-more"><a href="http://www.cylindric.net/blog/2011/07/arduino-and-the-sparkfun-serial-graphical-lcd-backpack/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cylindric.net/blog/wp-content/uploads/sparkfun_glcd-e1310384939135.jpg"><img class="alignleft size-thumbnail wp-image-14" title="SparkFun GLCD" src="http://www.cylindric.net/blog/wp-content/uploads/sparkfun_glcd-e1310384939135-150x150.jpg" alt="" width="90" height="90" /></a>I&#8217;m trying my hand at controlling a 128&#215;64 pixel <a title="Graphic LCD 128x64 STN LED Backlight" href="http://www.sparkfun.com/products/710" target="_blank">Graphical LCD screen</a> (GLCD) from my little <a title="Arduino" href="http://www.arduino.cc" target="_blank">Arduino</a> Uno.  Now, this thing uses the fairly common KS0108B parallel interface, which is great, but requires about 20 pins to control.  In order to bring this down to a more manageable level, I also bought a <a title="SparkFun Graphic LCD Serial Backpack" href="http://www.sparkfun.com/products/9352" target="_blank">Sparkfun Graphic LCD Serial Backpack</a>, which provides a nice simple serial interface.</p>
<p><span id="more-8"></span></p>
<h1>Basic Interaction</h1>
<p>To start off, and to ensure I&#8217;d hooked things up correctly, I use the hardware TX pin 1 on the Arduino.  This means I don&#8217;t have to worry about SoftSerial or NewSoftSerial or anything like that.</p>
<p>Here&#8217;s a quick sketch that resets the screen, then runs the built-in demo.  It&#8217;s probably best to temporarily disconnect the TX lead to the GLCD, otherwise all sorts of garbage will be printed out as the screen &#8216;sees&#8217; the data going to the PC&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Clear the screen and start the demo</span>
<span style="color: #0000ff;">void</span> setup<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  Serial.<span style="color: #007788;">begin</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">115200</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  Serial.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x7C</span>, BYTE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Command</span>
  Serial.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x00</span>, BYTE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Clear</span>
  Serial.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x7C</span>, BYTE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Command</span>
  Serial.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #208080;">0x04</span>, BYTE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Demo</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> loop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<h1>Resetting the Baud</h1>
<p>The GLCD backpack communicates by default at the maximum speed of 115,200, but that can be changed using a command.  Whenver I&#8217;ve set it slower for testing (I was having trouble using NewSoftSerial at max speed), the easiest way to set it back to max is simply to bash the hardware serial port when the screen boots up.</p>
<p>To make this simple, I created a bare sketch that just opens the serial port and whacks out bits at 115,200.  To use this:</p>
<ol>
<li>Disconnect the GLCD&#8217;s +V pin</li>
<li>Upload the sketch</li>
<li>The Arduino is now cheerily bashing out the letter &#8220;a&#8221; at it&#8217;s max rate</li>
<li>Connect the GLCD&#8217;s +V pin again</li>
<li>The GLCD will now power up, and see 115,200 bits coming at it, and switch itself to that speed</li>
</ol>
<p>Here&#8217;s the sketch:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Just send characters to the serial port</span>
<span style="color: #0000ff;">void</span> setup<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  Serial.<span style="color: #007788;">begin</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">115200</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> loop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  Serial.<span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;a&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cylindric.net/blog/2011/07/arduino-and-the-sparkfun-serial-graphical-lcd-backpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

