<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-822079314531495291</id><updated>2024-09-25T20:04:19.797-07:00</updated><category term="Arduino"/><category term="programming"/><category term="robotics"/><category term="tutorial"/><category term="ADXL"/><category term="ADXL345"/><category term="IDG"/><category term="IDG500"/><category term="IMU"/><category term="Lego"/><category term="Lego NXT"/><category term="MCU"/><category term="Mindstorms"/><category term="Robots"/><category term="Vex"/><category term="accelerometer"/><category term="arduino.cc"/><category term="arduino.com"/><category term="code"/><category term="example"/><category term="gyro"/><category term="gyroscope"/><category term="help"/><category term="hobbies"/><category term="hobby"/><category term="inertial"/><category term="jeroen"/><category term="measurement"/><category term="microcontrollers"/><category term="sparkfun"/><category term="waning"/><title type='text'>Arduino Robotics</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-6173250235514852007</id><published>2012-04-11T13:13:00.001-07:00</published><updated>2012-04-11T13:15:43.899-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="Lego NXT"/><category scheme="http://www.blogger.com/atom/ns#" term="Robots"/><title type='text'>Arduino or Lego Robots NXT?</title><content type='html'>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;

&lt;meta name=&quot;description&quot; content=&quot;When do kids make the switch from Lego Robotics to the more advanced Arduino? &quot; /&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;Arduino, Lego, Robots&quot; /&gt;
&lt;title&gt;Arduino or Lego Robots NXT?&lt;/title&gt;
&lt;/head&gt;

One particular type of toy that has dramatically shaped the lives of many was the Lego building brick. These colorful puzzle pieces can be used to create some impressive little replicas or even something completely original straight out of the mind of a child. From a carpenter&#39;s wood shop in Denmark, the original Lego brick was made out of wood, and they could not be directly attached to each other. However, with the reinvention of these classic toys in the mid-twentieth century, the plastic building bricks allow for some imaginative creations by allowing quicker assembly.
Many experts say playing with Lego can actually make your child more intelligent, and sure it doesn&#39;t seem so surprising. However, many children of today&#39;s generations are spoiled by the relatively new digital era. These technology-wielding kids are hypnotized by video games, computer games, and of course the television. The other (inanimate) toys have been packed up for storage or are sold on the internet.
Lego came up with the brilliant plan to marry the unparalleled entertainment of video games and computers with the original style building bricks our children of generation X and generation Y had been so familiar with. Lego Minstorms NXT Robots was thus born, and this ingenious new product undeniably exceeded expectations by many.

&lt;h1&gt;Lego Mindstorms&lt;/h1&gt;

Lego had really upped the ante with their Mindstorms NXT Robots robotics toys for teens and pre-teens when they released this all-encompassing critical thinking platform. Lego seems to have adapted their marketing strategy originally aimed at young children who restlessly required arranging blocks into a myriad of different projects. NXT Robots are thus a welcoming change.
Lego Mindstorms NXT Robots revolutionized the toy industry as it was now geared towards entertaining kids as well as serving eager engineering and technical minds in terms of education. Schools all over the world have incorporated the Lego Mindstorms NXT Robots platforms into educating students on mechanical engineering, computer science, and control systems with sensory feedback. Children who are mechanically inclined can now freely express themselves and advance their imaginative creativity, and engineering students around the globe have a fun and simple way to delve into entry-level robotics systems.


&lt;p&gt;Want to find out more about &lt;a href=&#39;http://jeroenwaning.blogspot.com&#39;&gt;robotics engineering&lt;/a&gt;? Visit &lt;a href=&#39;http://jeroenwaning.blogspot.com&#39;&gt;Engineering The Future&lt;/a&gt;.&lt;/p&gt;

Those who are read for more advanced robotics development tools, read earlier blogs to learn more about the Arduino.</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/6173250235514852007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/04/arduino-or-lego-robots-nxt.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/6173250235514852007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/6173250235514852007'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/04/arduino-or-lego-robots-nxt.html' title='Arduino or Lego Robots NXT?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-4645244268743016192</id><published>2012-03-02T13:55:00.002-08:00</published><updated>2012-04-11T12:52:39.700-07:00</updated><title type='text'>arduino tutorials news update</title><content type='html'>Hey guys,
I have been kind of slow with adding new tutorials for the Arduino recently because I have been busy building a website about robotics and tutorials. It is nowhere near completion, but if you want a sneak peak &lt;a href=&quot;http://www.waningenterprises.com/&quot;&gt;click here!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It still needs a lot of work and is mainly still a secret, but you can already find some cool stuff there. Bookmark it, and come back to it in a week or so! :) Thanks for reading.</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/4645244268743016192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/03/hey-guysi-have-been-kind-of-slow-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/4645244268743016192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/4645244268743016192'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/03/hey-guysi-have-been-kind-of-slow-with.html' title='arduino tutorials news update'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-2501893249466308126</id><published>2012-02-14T09:17:00.001-08:00</published><updated>2012-04-13T19:26:22.464-07:00</updated><title type='text'>Arduino Robotics News Update</title><content type='html'>Welcome back guys! I apologize for being a bit behind with providing more Arduino tutorials, but I promise they are coming. I am in the process of working with some major online electronics hobby sites (such as &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;sparkfun.com&lt;/a&gt;)&amp;nbsp;to provide the best Arduino and robotics related tutorials, news, sample code, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Please do not be afraid to post comments here!&lt;/b&gt;&amp;nbsp;I would love for anyone to share their comments, questions, contributions, or just a few words regarding the Arduino or robotics. If anyone has their own tutorials to contribute, please just post them here in the comments! &lt;i&gt;Blogging is becoming my way of life, and I need your support to start (and hopefully continue) providing real, useful, and relevant resources for free.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
Please stop by frequently, and let me know if there is anything I can do for you!&lt;b style=&quot;background-color: #9fc5e8;&quot;&gt;&lt;a href=&quot;http://jeroenwaning.blogspot.com/&quot;&gt; I have recently finished a major project regarding the &lt;a href=&quot;http://www.amazon.com/gp/product/B004CG4CN4/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=waningenterp-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B004CG4CN4&quot;&gt;Arduino UNO board&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=waningenterp-20&amp;l=as2&amp;o=1&amp;a=B004CG4CN4&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;, and it may be relevant and useful to you because I will provide you with research/content you wish regarding it - for FREE (of course).&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;

&lt;b&gt;If you want to learn about &lt;a href=&quot;http://www.555timercircuits.org&quot;&gt;555 timer circuits&lt;/a&gt;, check out &lt;a href=&quot;http://www.555timercircuits.org/555-timer-circuits-flashing-led/&quot;&gt;this website.&lt;/b&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=J0PnIyyydPE&quot;&gt;See the quick video here!&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqVI1bN551_5PlM8KNVWI-6EB9XinmB7XUA9TssFMc3T3MpPfI_xRLfPMBejoh-hfPzyQr74J0LFlYyvn5Al2drHroUnKkgtiawgjeKm4oO2hXdX9x6h2rGW6n4boFP77OIRq0shQCRaU/s1600/profilePic3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqVI1bN551_5PlM8KNVWI-6EB9XinmB7XUA9TssFMc3T3MpPfI_xRLfPMBejoh-hfPzyQr74J0LFlYyvn5Al2drHroUnKkgtiawgjeKm4oO2hXdX9x6h2rGW6n4boFP77OIRq0shQCRaU/s1600/profilePic3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/html&gt;&lt;a href=&quot;http://bloggers.com/technology/popular&quot; rel=&quot;dofollow&quot; &gt;&lt;img src=&quot;http://bloggers.com/b/55697/technology/img_03.png&quot; title=&quot;I&#39;m listed in Technology&quot; alt=&quot;I&#39;m listed in Technology&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/2501893249466308126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/welcome-back-guys-i-apologize-for-being.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/2501893249466308126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/2501893249466308126'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/welcome-back-guys-i-apologize-for-being.html' title='Arduino Robotics News Update'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqVI1bN551_5PlM8KNVWI-6EB9XinmB7XUA9TssFMc3T3MpPfI_xRLfPMBejoh-hfPzyQr74J0LFlYyvn5Al2drHroUnKkgtiawgjeKm4oO2hXdX9x6h2rGW6n4boFP77OIRq0shQCRaU/s72-c/profilePic3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-4610097505647375126</id><published>2012-02-13T12:57:00.001-08:00</published><updated>2012-02-15T09:23:33.308-08:00</updated><title type='text'>ADXL345 Tutorial</title><content type='html'>Today, I have started to set up my ADXL345 tutorial as I had promised. I wanted to go ahead and share the&amp;nbsp;&lt;a href=&quot;http://www.youtube.com/watch?v=4eyQJgTIFNE&quot;&gt;YouTube&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.youtube.com/watch?v=4eyQJgTIFNE&quot;&gt;&lt;/a&gt;video of it working.&amp;nbsp;&lt;a href=&quot;http://www.youtube.com/watch?v=4eyQJgTIFNE&quot;&gt;Click here&lt;/a&gt;&amp;nbsp;to see what the end result could look like if you hook it up properly.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;u style=&quot;font-weight: bold;&quot;&gt;Video:&lt;/u&gt;&amp;nbsp;&lt;/span&gt; &amp;nbsp;&lt;a href=&quot;http://www.youtube.com/watch?v=4eyQJgTIFNE&quot;&gt;http://www.youtube.com/watch?v=4eyQJgTIFNE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you haven&#39;t gotten your ADXL345 triple-axis accelerometer yet,&amp;nbsp;&lt;a href=&quot;http://www.sparkfun.com/products/9836&quot;&gt;click here!&lt;/a&gt;&lt;br /&gt;
&lt;html&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--google_ad_client = &quot;ca-pub-0652523342076633&quot;;/* Ball-Bot5 */google_ad_slot = &quot;1469162822&quot;;google_ad_width = 468;google_ad_height = 60;//--&gt;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/center&gt;&lt;/html&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiblfj83ZVs0whd-ac9CuK1RYxBtGAeDAGuxjg9rkljIZ_v0JyUTDK_8DrihPBJnbDWy-dNg6O0_Thv-qGHje99zbugqkdE3XR_NIDSg-6vsHvfG7Q3IoXYOuDIFSr-gowLpgq69wgmG9k/s1600/09836-_01c_l_th.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiblfj83ZVs0whd-ac9CuK1RYxBtGAeDAGuxjg9rkljIZ_v0JyUTDK_8DrihPBJnbDWy-dNg6O0_Thv-qGHje99zbugqkdE3XR_NIDSg-6vsHvfG7Q3IoXYOuDIFSr-gowLpgq69wgmG9k/s1600/09836-_01c_l_th.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;The way of getting this little guy to work with your Arduino is very similar to the tutorial I posted earlier (below) regarding the IDG500. &lt;b&gt;So if you get stuck here, just scroll down for more detailed steps!&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
You should hook your ADXL345 up to your Arduino following the below pin configuration so that the example code (below) will work without any modifications. Of course, you are welcome to make modifications as necessary if you feel comfortable, and you are experienced enough to get them to work the way you want. This pin configuration will work with almost any Arduino. &lt;i&gt;Leave a comment below if you have any questions or need help!&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Pin configuration:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie3bg3Gp2_QMAApi-iwy2dGC-UyNXoaWLEE_2B6VffsJ0zJAMv5IkzgX9JpkPARPHAiciC8Y4HW3dnKYN4nlu2qVUqh15IuWFT32ws-0-cwGVowVvrv2NnZBW7CZ17-EelPZuLE6oL27I/s1600/wiringTable.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie3bg3Gp2_QMAApi-iwy2dGC-UyNXoaWLEE_2B6VffsJ0zJAMv5IkzgX9JpkPARPHAiciC8Y4HW3dnKYN4nlu2qVUqh15IuWFT32ws-0-cwGVowVvrv2NnZBW7CZ17-EelPZuLE6oL27I/s1600/wiringTable.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
For those of you who are visual learners, I provide you with the following wiring diagram:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBnsghE4ATbW95oOz5KEhW-cR4Rdyx7obveZuHS0E0aZKx7J5WzxRFpKPfV9uFXgBHFeObY-GAJOdVyMQPH72HqOH-5jYEHUigObXac7k12Kq42V7W18JLs7NZodH2pTIrc8z6vaLEEWE/s1600/wiringDiagram.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBnsghE4ATbW95oOz5KEhW-cR4Rdyx7obveZuHS0E0aZKx7J5WzxRFpKPfV9uFXgBHFeObY-GAJOdVyMQPH72HqOH-5jYEHUigObXac7k12Kq42V7W18JLs7NZodH2pTIrc8z6vaLEEWE/s320/wiringDiagram.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Make sure your wires are hooked up right! I have burned out quite a few Arduinos because of careless mistakes. If you find yourself hooking things up too fast because you just want the darn thing to work, SLOW DOWN and double check everything! Numerous times I was SO sure I had everything hooked up right and then found out nothing worked. Even worse - you think you have everything right and then fry your brand new Arduino! If you&#39;re in the same boat, please read my original post below to find out how you can make your own Arduino for super cheap! I digress.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Here is the sample code that corresponds to the above wiring (thanks to &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;sparkfun.com&lt;/a&gt;):&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;color: #4a4a44; font-size: 12px; line-height: 15px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Add&amp;nbsp;the&amp;nbsp;SPI&amp;nbsp;library&amp;nbsp;so&amp;nbsp;we&amp;nbsp;can&amp;nbsp;communicate&amp;nbsp;with&amp;nbsp;the&amp;nbsp;ADXL345&amp;nbsp;sensor&lt;/span&gt;#include&amp;nbsp;&amp;lt;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.h&amp;gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Assign&amp;nbsp;the&amp;nbsp;Chip&amp;nbsp;Select&amp;nbsp;signal&amp;nbsp;to&amp;nbsp;pin&amp;nbsp;10.&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt; CS=10;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;list&amp;nbsp;of&amp;nbsp;some&amp;nbsp;of&amp;nbsp;the&amp;nbsp;registers&amp;nbsp;available&amp;nbsp;on&amp;nbsp;the&amp;nbsp;ADXL345.&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//To&amp;nbsp;learn&amp;nbsp;more&amp;nbsp;about&amp;nbsp;these&amp;nbsp;and&amp;nbsp;the&amp;nbsp;rest&amp;nbsp;of&amp;nbsp;the&amp;nbsp;registers&amp;nbsp;on&amp;nbsp;the&amp;nbsp;ADXL345,&amp;nbsp;read&amp;nbsp;the&amp;nbsp;datasheet!&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; POWER_CTL = 0x2D; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Power Control Register&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATA_FORMAT = 0x31;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAX0 = 0x32; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//X-Axis Data 0&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAX1 = 0x33; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//X-Axis Data 1&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAY0 = 0x34; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Y-Axis Data 0&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAY1 = 0x35; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Y-Axis Data 1&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAZ0 = 0x36; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Z-Axis Data 0&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; DATAZ1 = 0x37; &lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Z-Axis Data 1&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//This&amp;nbsp;buffer&amp;nbsp;will&amp;nbsp;hold&amp;nbsp;values&amp;nbsp;read&amp;nbsp;from&amp;nbsp;the&amp;nbsp;ADXL345&amp;nbsp;registers.&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; values[10];&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//These&amp;nbsp;variables&amp;nbsp;will&amp;nbsp;be&amp;nbsp;used&amp;nbsp;to&amp;nbsp;hold&amp;nbsp;the&amp;nbsp;x,y&amp;nbsp;and&amp;nbsp;z&amp;nbsp;axis&amp;nbsp;accelerometer&amp;nbsp;values.&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt; x,y,z;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;color: #4a4a44; font-size: 12px; line-height: 15px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;setup&lt;/b&gt;&lt;/span&gt;(){ &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Initiate an SPI communication instance.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;begin&lt;/span&gt;();&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Configure the SPI connection for the ADXL345.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;setDataMode&lt;/span&gt;(&lt;span style=&quot;color: #006699;&quot;&gt;SPI_MODE3&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Create a serial connection to display the data on the terminal.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;begin&lt;/span&gt;(9600);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Set up the Chip Select pin to be an output from the Arduino.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;pinMode&lt;/span&gt;(CS, &lt;span style=&quot;color: #006699;&quot;&gt;OUTPUT&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Before communication starts, the Chip Select pin needs to be set high.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;digitalWrite&lt;/span&gt;(CS, &lt;span style=&quot;color: #006699;&quot;&gt;HIGH&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register.&lt;/span&gt;&amp;nbsp;&amp;nbsp;writeRegister(DATA_FORMAT,&amp;nbsp;0x01);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register.&lt;/span&gt;&amp;nbsp;&amp;nbsp;writeRegister(POWER_CTL,&amp;nbsp;0x08);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Measurement mode  &lt;/span&gt;}&lt;span style=&quot;color: #cc6600;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;loop&lt;/b&gt;&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Reading 6 bytes of data starting at register DATAX0 will retrieve the x,y and z acceleration values from the ADXL345.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//The results of the read operation will get stored to the values[] buffer.&lt;/span&gt;&amp;nbsp;&amp;nbsp;readRegister(DATAX0,&amp;nbsp;6,&amp;nbsp;values);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//The ADXL345 gives 10-bit acceleration values, but they are stored as bytes (8-bits). To get the full value, two bytes must be combined for each axis.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//The X value is stored in values[0] and values[1].&lt;/span&gt;&amp;nbsp;&amp;nbsp;x&amp;nbsp;=&amp;nbsp;((&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[1]&amp;lt;&amp;lt;8)|(&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[0];&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//The Y value is stored in values[2] and values[3].&lt;/span&gt;&amp;nbsp;&amp;nbsp;y&amp;nbsp;=&amp;nbsp;((&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[3]&amp;lt;&amp;lt;8)|(&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[2];&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//The Z value is stored in values[4] and values[5].&lt;/span&gt;&amp;nbsp;&amp;nbsp;z&amp;nbsp;=&amp;nbsp;((&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[5]&amp;lt;&amp;lt;8)|(&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt;)values[4];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Print the results to the terminal.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;print&lt;/span&gt;(x, &lt;span style=&quot;color: #006699;&quot;&gt;DEC&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #006699;&quot;&gt;&#39;,&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;print&lt;/span&gt;(y, &lt;span style=&quot;color: #006699;&quot;&gt;DEC&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #006699;&quot;&gt;&#39;,&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;println&lt;/span&gt;(z, &lt;span style=&quot;color: #006699;&quot;&gt;DEC&lt;/span&gt;);      &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;delay&lt;/span&gt;(10); }&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;color: #4a4a44; font-size: 12px; line-height: 15px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//This&amp;nbsp;function&amp;nbsp;will&amp;nbsp;write&amp;nbsp;a&amp;nbsp;value&amp;nbsp;to&amp;nbsp;a&amp;nbsp;register&amp;nbsp;on&amp;nbsp;the&amp;nbsp;ADXL345.&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Parameters:&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//&amp;nbsp;&amp;nbsp;char&amp;nbsp;registerAddress&amp;nbsp;-&amp;nbsp;The&amp;nbsp;register&amp;nbsp;to&amp;nbsp;write&amp;nbsp;a&amp;nbsp;value&amp;nbsp;to&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//&amp;nbsp;&amp;nbsp;char&amp;nbsp;value&amp;nbsp;-&amp;nbsp;The&amp;nbsp;value&amp;nbsp;to&amp;nbsp;be&amp;nbsp;written&amp;nbsp;to&amp;nbsp;the&amp;nbsp;specified&amp;nbsp;register.&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;void&lt;/span&gt; writeRegister(&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; registerAddress, &lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; value){&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Set Chip Select pin low to signal the beginning of an SPI packet.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;digitalWrite&lt;/span&gt;(CS, &lt;span style=&quot;color: #006699;&quot;&gt;LOW&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Transfer the register address over SPI.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;transfer&lt;/span&gt;(registerAddress);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Transfer the desired register value over SPI.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;transfer&lt;/span&gt;(value);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Set the Chip Select pin high to signal the end of an SPI packet.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;digitalWrite&lt;/span&gt;(CS, &lt;span style=&quot;color: #006699;&quot;&gt;HIGH&lt;/span&gt;);}&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//This&amp;nbsp;function&amp;nbsp;will&amp;nbsp;read&amp;nbsp;a&amp;nbsp;certain&amp;nbsp;number&amp;nbsp;of&amp;nbsp;registers&amp;nbsp;starting&amp;nbsp;from&amp;nbsp;a&amp;nbsp;specified&amp;nbsp;address&amp;nbsp;and&amp;nbsp;store&amp;nbsp;their&amp;nbsp;values&amp;nbsp;in&amp;nbsp;a&amp;nbsp;buffer.&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Parameters:&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//&amp;nbsp;&amp;nbsp;char&amp;nbsp;registerAddress&amp;nbsp;-&amp;nbsp;The&amp;nbsp;register&amp;nbsp;addresse&amp;nbsp;to&amp;nbsp;start&amp;nbsp;the&amp;nbsp;read&amp;nbsp;sequence&amp;nbsp;from.&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//&amp;nbsp;&amp;nbsp;int&amp;nbsp;numBytes&amp;nbsp;-&amp;nbsp;The&amp;nbsp;number&amp;nbsp;of&amp;nbsp;registers&amp;nbsp;that&amp;nbsp;should&amp;nbsp;be&amp;nbsp;read.&lt;/span&gt;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//&amp;nbsp;&amp;nbsp;char&amp;nbsp;*&amp;nbsp;values&amp;nbsp;-&amp;nbsp;A&amp;nbsp;pointer&amp;nbsp;to&amp;nbsp;a&amp;nbsp;buffer&amp;nbsp;where&amp;nbsp;the&amp;nbsp;results&amp;nbsp;of&amp;nbsp;the&amp;nbsp;operation&amp;nbsp;should&amp;nbsp;be&amp;nbsp;stored.&lt;/span&gt;&lt;span style=&quot;color: #cc6600;&quot;&gt;void&lt;/span&gt; readRegister(&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; registerAddress, &lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt; numBytes, &lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; * values){&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Since we&#39;re performing a read operation, the most significant bit of the register address should be set.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;char&lt;/span&gt; address = 0x80 | registerAddress;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//If we&#39;re doing a multi-byte read, bit 6 needs to be set as well.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;if&lt;/span&gt;(numBytes &amp;gt; 1)address = address | 0x40;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Set the Chip select pin low to start an SPI packet.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;digitalWrite&lt;/span&gt;(CS, &lt;span style=&quot;color: #006699;&quot;&gt;LOW&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Transfer the starting register address that needs to be read.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;SPI&lt;/span&gt;.&lt;span style=&quot;color: #cc6600;&quot;&gt;transfer&lt;/span&gt;(address);&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Continue to read registers until we&#39;ve read the number specified, storing the results to the input buffer.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc6600;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #cc6600;&quot;&gt;int&lt;/span&gt; &amp;nbsp;&lt;i=0; style=&quot;color: #cc6600;&quot;&gt;SPI.transfer(0x00);&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #7e7e7e;&quot;&gt;//Set the Chips Select pin high to end the SPI packet.&lt;/span&gt;&amp;nbsp;&amp;nbsp;digitalWrite(CS, &lt;span style=&quot;color: #006699;&quot;&gt;HIGH&lt;/span&gt;);}&lt;/i=0;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Compile and upload this example code to your Arduino, and presto! &lt;i&gt;If you have any issues or questions, please leave a comment below. I check my blogs daily.&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Now that you have it working, challenge yourself to build a similar project as seen in the&amp;nbsp;&lt;a href=&quot;http://www.youtube.com/watch?v=4eyQJgTIFNE&quot;&gt;YouTube&lt;/a&gt;&amp;nbsp;video.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://bloggers.com/technology/popular&quot; rel=&quot;dofollow&quot; &gt;&lt;img src=&quot;http://bloggers.com/b/55697/technology/img_03.png&quot; title=&quot;I&#39;m listed in Technology&quot; alt=&quot;I&#39;m listed in Technology&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/4610097505647375126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/adxl345-tutorial.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/4610097505647375126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/4610097505647375126'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/adxl345-tutorial.html' title='ADXL345 Tutorial'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiblfj83ZVs0whd-ac9CuK1RYxBtGAeDAGuxjg9rkljIZ_v0JyUTDK_8DrihPBJnbDWy-dNg6O0_Thv-qGHje99zbugqkdE3XR_NIDSg-6vsHvfG7Q3IoXYOuDIFSr-gowLpgq69wgmG9k/s72-c/09836-_01c_l_th.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-8670489011482254390</id><published>2012-02-11T16:02:00.001-08:00</published><updated>2012-04-11T12:52:53.168-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="accelerometer"/><category scheme="http://www.blogger.com/atom/ns#" term="ADXL"/><category scheme="http://www.blogger.com/atom/ns#" term="ADXL345"/><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="example"/><category scheme="http://www.blogger.com/atom/ns#" term="gyro"/><category scheme="http://www.blogger.com/atom/ns#" term="gyroscope"/><category scheme="http://www.blogger.com/atom/ns#" term="help"/><category scheme="http://www.blogger.com/atom/ns#" term="IDG"/><category scheme="http://www.blogger.com/atom/ns#" term="IDG500"/><category scheme="http://www.blogger.com/atom/ns#" term="IMU"/><category scheme="http://www.blogger.com/atom/ns#" term="inertial"/><category scheme="http://www.blogger.com/atom/ns#" term="jeroen"/><category scheme="http://www.blogger.com/atom/ns#" term="measurement"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="robotics"/><category scheme="http://www.blogger.com/atom/ns#" term="sparkfun"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="waning"/><title type='text'>Arduino, IDG500, and ADXL345 tutorial</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Introduction&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;As part of my&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;a href=&quot;http://jeroenwaning.blogspot.com/&quot;&gt;Ball-Bot&lt;/a&gt;&amp;nbsp;senior design project, I used the &lt;a href=&quot;http://www.arduino.cc/&quot;&gt;Arduino&lt;/a&gt;&amp;nbsp;in combination with an Inertial Measurement Unit (IMU) I made myself with the ADXL345 and IDG500. Respectively, these are the accelerometer and the gyroscope. Namely, they measure acceleration and angular velocity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDvALrPkfUqragekkPntiaRhOp-K0NDxiafevdCXWohA19EEXrGB3V4RWyYXRzg-JeuH1rDGBgF73TsOY7D6zfEceVmSsR_ZfBk4XuYio4S5Z1b6G6pwMfKosJYxrtxZldtB1JPAQTyU/s1600/09836-_01c_l_th.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDvALrPkfUqragekkPntiaRhOp-K0NDxiafevdCXWohA19EEXrGB3V4RWyYXRzg-JeuH1rDGBgF73TsOY7D6zfEceVmSsR_ZfBk4XuYio4S5Z1b6G6pwMfKosJYxrtxZldtB1JPAQTyU/s1600/09836-_01c_l_th.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: small;&quot;&gt;ADXL345&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;I wanted to post my successes with these little goodies I purchased from&amp;nbsp;&lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;sparkfun.com&lt;/a&gt;, and provide some good information if people were interested in trying them out for themselves. I am assuming that you are somewhat familiar with the Arduino and have an ADXL345 and/or an IDG500. &lt;i&gt;I will have an Arduino tutorial for beginners coming soon, and the link will be posted here!&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr39J7vqH0AM5XEwbsw7Mb7nHEkBM0OykfKevGf8zhYVxR6fnwi1frNxef2TV8d6eJ03k3IryeLhisAA2dDw8dqT6Q3vsoEfPRx7us_5Nqfrbd5nN0wtFyCUrWHaYwm3zJBdSLxC2lNSM/s1600/09094-03-L_l_th.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr39J7vqH0AM5XEwbsw7Mb7nHEkBM0OykfKevGf8zhYVxR6fnwi1frNxef2TV8d6eJ03k3IryeLhisAA2dDw8dqT6Q3vsoEfPRx7us_5Nqfrbd5nN0wtFyCUrWHaYwm3zJBdSLxC2lNSM/s1600/09094-03-L_l_th.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: small;&quot;&gt;IDG500 Gyroscope&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;I will start with the IDG500 first, but a tutorial for the ADXL345 is coming soon, and a link will be provided here. I will provide wiring examples and of course, the code to get them fully functional. I personally used the Arduino UNO and the Arduino MEGA 2560, but you can use any Arduino microcontroller. You can even use any microcontroller other than the Arduino if you want, but the code posted here may not work as it is presented verbatim. However, for those advanced users, you will recognize that the logic is simple and will generally transfer over to any development board.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;IDG500 Gyroscope Tutorial&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Get your Arduino and the IDG500 ready for some wiring. I am assuming your IDG500 looks like the one in the picture above (meaning it is pre-assembled on the breakout board). If your IDG500 is not yet soldered onto a breakout board and looks like a tiny black square (as seen in the middle of the picture above), you will need to do this first! If you are not comfortable soldering SMD (surface mount devices), you can easily &lt;a href=&quot;http://www.youtube.com/watch?v=3NN7UGWYmBY&quot;&gt;learn here&lt;/a&gt;, or see if you can still return your IDG500 and swap it out for one on a breakout board.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;To make wiring much easier, you will need to solder some metal pins onto your IDG500 so it can be placed on your breadboard and allow for a solid connection. They come in strips as seen in the picture below, and you snap off the exact number you need.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4QdCZn_4-lNiu7VXlY1_P54oiv-5JVITgv7qxG0HsvsIZlavIjH4wYnk3B4kt3VKI8XEInnVMqYFT7JvOA5uVh3t6F9YHJ78xSeH-jtUWeoy3IpWm9b2Wazg9ZMlEJegIoS_4ZPlZFYE/s1600/images+(1).jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4QdCZn_4-lNiu7VXlY1_P54oiv-5JVITgv7qxG0HsvsIZlavIjH4wYnk3B4kt3VKI8XEInnVMqYFT7JvOA5uVh3t6F9YHJ78xSeH-jtUWeoy3IpWm9b2Wazg9ZMlEJegIoS_4ZPlZFYE/s1600/images+(1).jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;They are very easy to solder on, and they will save you a lot of time and hassle when connecting any breakout board to your breadboard!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Here is the schematic and wiring example for the IDG500. It may seem a bit confusing, but you will soon realize it is actually quite simple, and I will walk you through each connection step by step.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnbSyXg5DVkEGnAanB8jMMYFF6kPqqIKVgRgoC_4Q-hXGRMNVn-cE5RFFkkVIHQuarbfE0sVYbugcxxFHAOmCbgTcRlfFuo0UPNqG5974Yb8oBaFnJ8ONC1hbVy6Gzvgw2Vabg9tNkkM/s1600/GyroIDG500.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnbSyXg5DVkEGnAanB8jMMYFF6kPqqIKVgRgoC_4Q-hXGRMNVn-cE5RFFkkVIHQuarbfE0sVYbugcxxFHAOmCbgTcRlfFuo0UPNqG5974Yb8oBaFnJ8ONC1hbVy6Gzvgw2Vabg9tNkkM/s640/GyroIDG500.png&quot; width=&quot;408&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Really there are only four wires that will connect your IDG500 to your Arduino. The red and black connect power and ground between the IDG500 and Arduino, and the blue and green connect the x and y pins to the Arduino&#39;s analog input pins. This will be explained in more detail below, and you can of course use any wire colors you like (as I&#39;m sure you already know).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Let&#39;s go ahead and get the code onto your Arduino first. By writing the code first (or copying and pasting), you will be able to define the pin configuration yourself. Of course you can use the pin numbers in this tutorial, but you may want to modify them in case you have other things hooked up to your Arduino, or perhaps, you are using a different Arduino/microcontroller.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;keyword1&quot;&gt;int&lt;/span&gt; x, y;  &lt;span class=&quot;comment&quot;&gt;// X and Y in-plane sensing&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;keyword1&quot;&gt;int&lt;/span&gt; pin0 = 0; //define pin0 on the Arduino&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;keyword1&quot;&gt;int&lt;/span&gt; pin1 = 1; //define pin1 on the Arduino&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;keyword1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;keyword2&quot;&gt;setup&lt;/span&gt;(){  &lt;span class=&quot;keyword1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;keyword2&quot;&gt;begin&lt;/span&gt;(9600);      &lt;span class=&quot;comment&quot;&gt;// sets the serial port to 9600&lt;/span&gt;}&lt;span class=&quot;keyword1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;keyword2&quot;&gt;loop&lt;/span&gt;(){  x = &lt;span class=&quot;keyword2&quot;&gt;analogRead&lt;/span&gt;(pin0);       &lt;span class=&quot;comment&quot;&gt;// &lt;span class=&quot;keyword2&quot;&gt;read&lt;/span&gt; analog input pin 0&lt;/span&gt;  y = &lt;span class=&quot;keyword2&quot;&gt;analogRead&lt;/span&gt;(pin1);       &lt;span class=&quot;comment&quot;&gt;// &lt;span class=&quot;keyword2&quot;&gt;read&lt;/span&gt; analog input pin 1&lt;/span&gt;  &lt;span class=&quot;keyword1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;keyword2&quot;&gt;print&lt;/span&gt;(&lt;span class=&quot;literal&quot;&gt;&quot;Angular velocities for\n x: &quot;&lt;/span&gt;);  &lt;span class=&quot;keyword1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;keyword2&quot;&gt;print&lt;/span&gt;(x, &lt;span class=&quot;literal2&quot;&gt;DEC&lt;/span&gt;);    &lt;span class=&quot;comment&quot;&gt;// &lt;span class=&quot;keyword2&quot;&gt;print&lt;/span&gt; the angular velocity in the&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; axis&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;  &lt;span class=&quot;keyword1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;keyword2&quot;&gt;print&lt;/span&gt;(&lt;span class=&quot;literal&quot;&gt;&quot; \ty: &quot;&lt;/span&gt;);       &lt;span class=&quot;comment&quot;&gt;// prints a space between the numbers&lt;/span&gt;  &lt;span class=&quot;keyword1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;keyword2&quot;&gt;println&lt;/span&gt;(y, &lt;span class=&quot;literal2&quot;&gt;DEC&lt;/span&gt;);  &lt;span class=&quot;comment&quot;&gt;// &lt;span class=&quot;keyword2&quot;&gt;print&lt;/span&gt; the angular velocity in the Y axis&lt;/span&gt;  &lt;span class=&quot;keyword2&quot;&gt;delay&lt;/span&gt;(100);              &lt;span class=&quot;comment&quot;&gt;// wait 100ms &lt;span class=&quot;keyword1&quot;&gt;for&lt;/span&gt; next reading&lt;/span&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;This code snippet is all there is too it, and it is as simple as it looks! The above code is the entire program that will read data from the IDG500 and relay it back to your serial monitor for you to check it out. Your pin configurations may vary on your Arduino, but pin0 and pin1 on your Arduino are the only pins that will be receiving data from the IDG500. The IDG500 is an analog gyroscope, and its x and y pins must be hooked up to any two analog pins on the Arduino. On the Arduino UNO, any of the pins 0 - 5 (under &#39;analog in&#39;) will work (for this code example, 0 and 1 were used). On the Arduino MEGA 2560, your analog pins are pins A0 - A15.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;If you are wondering how the Arduino can read analog data, it really can&#39;t (or at least not the IC that lies at the heart of your Arduino). The Arduinos come with an Analog-to-Digital (A/D) converter that converts the analog data from those pins to a digital sequence that can be interpreted by the microcontroller.&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;For the above code to work without any modifications, grab your Arduino UNO, IDG500, some wires, and follow these wiring steps:&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot; style=&quot;clear: both; margin-top: 10px;&quot;&gt;&lt;ol&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;Connect &#39;Vcc&#39; on the IDG500 to &#39;5V&#39; on the Arduino UNO&lt;/span&gt;&lt;/li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;Connect &#39;GND&#39; on the IDG500 to &#39;GND&#39; on the Arduino UNO (any &#39;GND&#39; will work)&lt;/span&gt;&lt;/li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;Connect &#39;xout&#39; on the IDG500 to &#39;0&#39; under &#39;analog in&#39; on the Arduino UNO&lt;/span&gt;&lt;/li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; white-space: normal;&quot;&gt;Connect &#39;yout&#39; on the IDG500 to &#39;1&#39; under &#39;analog in&#39; on the Arduino UNO&lt;/span&gt;&lt;/li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;/ol&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;If you want your IDG500 to be more sensitive (i.e. you are measuring very small increments in angular velocity), you may modify steps 3 and 4. Instead of using &#39;xout&#39; and &#39;yout&#39;, just connect &#39;x4.5out&#39; and &#39;y4.5out&#39; while leaving all other connections the same.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;After everything is hooked up, compile and upload the code to the Arduino.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Click the on the serial monitor in the Arduino interface after the program is running on the Arduino to see the x and y angular velocity data displayed numerically. The readings are taken every 100ms. You can play around with the delay() function without any bad things happening! Just remember that if you have it read the data too fast you just wont be able to read any of it. The data is displayed in decimal format defined by &#39;DEC&#39; in your Serial.print() function.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;I hope this tutorial helped, but I challenge you to go further and see what you can do with the IDG500! You can make some really cool robots with this gyro. &lt;b&gt;Check out this&amp;nbsp;&lt;/b&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=1Ml3eC5gSdc&quot;&gt;YouTube Video&lt;/a&gt;&amp;nbsp;&lt;b&gt;to see how you can take it a step further!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Please post any comments, suggestions, corrections, or questions, and I will check them regularly. Thanks!&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;a href=&quot;http://bloggers.com/jeroenwaning&quot; rel=&quot;dofollow&quot;&gt;&lt;span style=&quot;background-color: white; color: black;&quot;&gt;&lt;img alt=&quot;Jeroen Waning - Find me on Bloggers.com&quot; src=&quot;http://bloggers.com/b/55697/p/img_01.png&quot; title=&quot;Jeroen Waning - Find me on Bloggers.com&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://bloggers.com/technology/popular&quot; rel=&quot;dofollow&quot; &gt;&lt;img src=&quot;http://bloggers.com/b/55697/technology/img_03.png&quot; title=&quot;I&#39;m listed in Technology&quot; alt=&quot;I&#39;m listed in Technology&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/8670489011482254390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/arduino-idg500-and-adxl345-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/8670489011482254390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/8670489011482254390'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/arduino-idg500-and-adxl345-tutorial.html' title='Arduino, IDG500, and ADXL345 tutorial'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDvALrPkfUqragekkPntiaRhOp-K0NDxiafevdCXWohA19EEXrGB3V4RWyYXRzg-JeuH1rDGBgF73TsOY7D6zfEceVmSsR_ZfBk4XuYio4S5Z1b6G6pwMfKosJYxrtxZldtB1JPAQTyU/s72-c/09836-_01c_l_th.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-822079314531495291.post-6109608332239194054</id><published>2012-02-10T18:23:00.000-08:00</published><updated>2012-04-02T09:56:54.981-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="arduino.cc"/><category scheme="http://www.blogger.com/atom/ns#" term="arduino.com"/><category scheme="http://www.blogger.com/atom/ns#" term="hobbies"/><category scheme="http://www.blogger.com/atom/ns#" term="hobby"/><category scheme="http://www.blogger.com/atom/ns#" term="Lego"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="microcontrollers"/><category scheme="http://www.blogger.com/atom/ns#" term="Mindstorms"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="robotics"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Vex"/><title type='text'>Arduino Hobby Robotics</title><content type='html'>I have always been a robotics hobbyist, and I am currently a mechatronics engineering student at Southern Polytechnic State University. I have used Lego Mindstorms and Vex robotics to build some robot prototypes, and they have proven to be a great way to get involved in robotics without being overly complex. Lego Mindstorms &lt;a title=&quot;Lego Mindstorms NXT Robots&quot; href=&quot;http://www.nxtrobots.org&quot; rel=&quot;dofollow&quot;&gt;NXT Robots&lt;/a&gt; are simple the best way to get into robotics for both kids and college students.&lt;br /&gt;
I have since moved to a more advanced development platform called Arduino. The Arduino is a family of microcontrollers and comes with its own development environment. The Arduino is more advanced then the entry level robotics hobby kits, such as Lego Mindstorms and &amp;nbsp;Vex, but it is also more versatile and much more is possible.&lt;br /&gt;
There are several versions of the development boards available from Arduino (&lt;a href=&quot;http://www.arduino.cc/&quot;&gt;arduino.cc&lt;/a&gt;), and the prices are very reasonable (ranging from &amp;nbsp;US $20-$70) on ebay. The different versions allow you to find one that fits your budget and your specific robotics project.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFVzD5FNGi4jJjk1Djp5rGbrOZv3mkABXRWQnN450G0c6qYNgYI6gx645ehA0K6b7XDfTexvkyu1Rgd26Goa0m_04_hLmhnYTrBdczXDTR5_aF8hOeIqWlz4DPUG8zHd94wZ7LTkEd80/s1600/images.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFVzD5FNGi4jJjk1Djp5rGbrOZv3mkABXRWQnN450G0c6qYNgYI6gx645ehA0K6b7XDfTexvkyu1Rgd26Goa0m_04_hLmhnYTrBdczXDTR5_aF8hOeIqWlz4DPUG8zHd94wZ7LTkEd80/s1600/images.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Arduinos have many I/O pins (analog, digital, PWM) that allow for many actions such as driving motors and servos, receiving sensory input, lighting up LED, creating sound with buzzers, and much, much more! The great thing about the Arduino is that it is excellent for beginners as well as advanced electrical and robotics engineers. It makes for a great development tool for students in engineering and computer science, but mainly, it&#39;s just a whole lot of fun!&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;There is a myriad of accessories made directly for the Arduino, but many additional items can be used with it that are not directly designed for it. When an Arduino is purchased from a reputable vendor (such as &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;sparkfun.com&lt;/a&gt;) it usually comes in a kit that includes everything to get started. This kit may include wires, resistors, LEDs, motors, servos, and even sensors.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;As the user becomes more and more comfortable and experienced with the Arduino, the builds can become more complex and challenging, and the fun level only gets amped up!&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28UcFwgIVRTFDOqg3zN8oSIdyHN6AayPqoUh3YiOgvLpukg77-wSALN3QAnmwAKL-NY99cGD_27LKDe1R8bNI7Y4w0eZyGaMWj5Umu6j3qcPnmTyT3YOXD7TZexRfL-Uo766J2pnJQnM/s1600/images2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28UcFwgIVRTFDOqg3zN8oSIdyHN6AayPqoUh3YiOgvLpukg77-wSALN3QAnmwAKL-NY99cGD_27LKDe1R8bNI7Y4w0eZyGaMWj5Umu6j3qcPnmTyT3YOXD7TZexRfL-Uo766J2pnJQnM/s1600/images2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Arduino microcontrollers can be programmed with any Windows, Mac, or Linux computer, and Arduino offers a very simple development environment that allows users to write their programs in a user-friendly version of C. There are also many existing examples, tutorials, and online resources available that will facilitate virtually any homemade robotics project. There are even books written about the Arduino and how to use it, and there are even specialized books on specific projects that can be built with the Arduino.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgryZGK_gRUj5meb3p-MOrOkxEd7ZvK8Thtl5Oacg-uiK1iyL3esCMF31bFsp3u4Trc10LLbNOhEGpOG9-hgLwCzFMgbxWhRgA05ShTIAxO_LF-QQ5ljf67soUB2aeoqvqG7xiq9IZ6syM/s1600/images5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgryZGK_gRUj5meb3p-MOrOkxEd7ZvK8Thtl5Oacg-uiK1iyL3esCMF31bFsp3u4Trc10LLbNOhEGpOG9-hgLwCzFMgbxWhRgA05ShTIAxO_LF-QQ5ljf67soUB2aeoqvqG7xiq9IZ6syM/s1600/images5.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Arduino Robotics (ISBN#: 9781430231837 - &amp;nbsp;US $39.99) by John-David Warren, Josh Adams, and Harald Molle is one of my favorites. It guides the read by providing detailed instructions and helpful tips and tricks on how to make your very own robots! They are not just any robots; these are some cool and practical systems that provide real fun in designing and building them and using them.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;As seen on the cover, you even learn how to make your very own Segway robot called &#39;Seg-bot&#39; using the Arduino and some cheap parts you can find online, at RadioShack, or in someone else&#39;s scrap pile.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The book provides information on where each part can be found or how to make your own. When building the projects in this book, you are mostly given the option to either purchase a part or component that is already made or how to build your own. For example, the L298 motor driver boards can be purchased for about US $20-$35, but the L298 chip, copper-clad PCB, capacitors, diodes, etc. can be purchased for less than US $10. Detailed instructions are provided on how to make your very own motor driver board that looks professional and functions practically the same for less than half the price. The book even teaches you how to make your very own Arduino from scratch!&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;As many Arduino fanatics will testify, during your projects you will most likely make mistakes and burn up your Arduino on accident. Instead of buying a brand new Arduino each time you have destroyed one, many Arduino hobbyists are making their own Arduinos for a fraction of the cost. The book teaches you how to make your own printed circuit boards that will facilitate and expedite the Arduino clone making process.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;If by reading this blog you feel that this is too advanced for you, do not let me scare you. All the basics are covered in this book ranging from building beginner electrical circuits to writing your very first program.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;If you are serious about robotics or just want to have some real, educational fun, I would certainly buy an Arduino kit from&amp;nbsp;&lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;sparkfun.com&lt;/a&gt;&amp;nbsp;and then the Arduino Robotics book when you decide to continue with Arduino.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;I even used the Arduino in my senior design project. We built a robot that balances on a basketball! See it in my other blog&amp;nbsp;&lt;a href=&quot;http://jeroenwaning.blogspot.com/&quot;&gt;here.&lt;/a&gt;&amp;nbsp;Or see the YouTube video&amp;nbsp;&lt;center&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=J0PnIyyydPE&quot;&gt;here.&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/center&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://bloggers.com/jeroenwaning&quot; rel=&quot;dofollow&quot; &gt;&lt;img src=&quot;http://bloggers.com/b/55697/p/img_01.png&quot; title=&quot;Jeroen Waning - Find me on Bloggers.com&quot; alt=&quot;Jeroen Waning - Find me on Bloggers.com&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinorobotics.blogspot.com/feeds/6109608332239194054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/arduino-hobby-robotics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/6109608332239194054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/822079314531495291/posts/default/6109608332239194054'/><link rel='alternate' type='text/html' href='http://arduinorobotics.blogspot.com/2012/02/arduino-hobby-robotics.html' title='Arduino Hobby Robotics'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06041530427346324254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFVzD5FNGi4jJjk1Djp5rGbrOZv3mkABXRWQnN450G0c6qYNgYI6gx645ehA0K6b7XDfTexvkyu1Rgd26Goa0m_04_hLmhnYTrBdczXDTR5_aF8hOeIqWlz4DPUG8zHd94wZ7LTkEd80/s72-c/images.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>