<?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: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-2195458173067627156</id><updated>2012-02-01T04:18:01.361-08:00</updated><category term='Plus'/><category term='imu'/><category term='atmega'/><category term='microcontroller'/><category term='uav'/><category term='Arduino'/><category term='nunchuck'/><category term='hacks'/><category term='nintendo'/><category term='gyro'/><category term='Wii'/><category term='accelerometer'/><category term='WM+'/><category term='motionplus'/><category term='Motion'/><category term='avr'/><title type='text'>Random Hacks Of Boredom/Genius</title><subtitle type='html'>Title says it all. Hacking anything that has electricity running through it and even some things that dont.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.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>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-6793184205755608499</id><published>2010-11-16T00:34:00.000-08:00</published><updated>2010-11-16T00:56:56.210-08:00</updated><title type='text'>Bus Notifier Followup</title><content type='html'>So since the Bus Notifier project was completed, it has been running from about Sept 2009 til now. Ive moved apartments, but the code still works with a few tweaks. The real news is:&lt;br /&gt;&lt;br /&gt;1. I came in second in the Make Magazine and Design News sponsored Gadget Freak Design Contest. This was quite an honor (especially since I never win anything from contests). &lt;a href="http://blog.makezine.com/archive/2010/08/gadget_freak_design_contest_winners.html"&gt;Heres&lt;/a&gt; the contest results page. Plus $500 bucks will go a long way to help out with some of my other projects.&lt;br /&gt;&lt;br /&gt;2. Also...I got published in the Gadget Freak Section of the Design News Newsletter! Hooray. I had to do a professional photo shoot and everything. Also a huge honor (and another $500 for them using my submission). The site is &lt;a href="http://www.designnews.com/article/511491-Gadget_Freak_Case_File_174_Bus_Alert.php"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I am floored by all of this. To think that I got so much recognition from a simple project I designed to make my life easier is really amazing. Thanks so much to Make Magazine, Design News, and Hackaday for making all this possible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P.S. In other news, I have a few projects I ought to post that have been finished for a while. I made a little scrolling LED matrix for my girlfriend last valentines day. It was something that I could use to learn to use the PIC's I sampled for free and she loves it since I can upload new messages to it whenever I want. Im a sap, what can I say. &lt;br /&gt;I would also like to showcase my Isobot code properly eventually. It was an earlier project that Im quite proud of, but it never made it off the &lt;a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1237771631"&gt;forum post&lt;/a&gt; aside from a quick &lt;a href="http://blog.makezine.com/archive/2009/08/arduino_controlled_i-sobot.html"&gt;make magazine writeup&lt;/a&gt;. &lt;br /&gt;My biggest projects right now are school related: Building a quadcopter for a robotics class, my Mechanical Senior Design class, and looking for a job take up most of my time. The quadcopter is showcase on the tab above named "Horus Quadcopter Robot"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-6793184205755608499?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/6793184205755608499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/11/bus-notifier-followup.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6793184205755608499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6793184205755608499'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/11/bus-notifier-followup.html' title='Bus Notifier Followup'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-6985449461665670253</id><published>2010-04-10T13:02:00.000-07:00</published><updated>2010-11-15T22:15:04.641-08:00</updated><title type='text'>Videos For My Bus Status Updater</title><content type='html'>Here are a few videos for the previous post. Sorry for the poor camera quality. All I have is a cameraphone to work with. &lt;br /&gt;&lt;br /&gt;&lt;object width="360" height="200"&gt;&lt;param name="movie" value="http://www.youtube.com/v/1mBjcub1EkI&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/1mBjcub1EkI&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="360" height="200"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="360" height="200"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4Iinq1c0vPg&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4Iinq1c0vPg&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="360" height="200"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-6985449461665670253?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/6985449461665670253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/04/videos-for-my-bus-status-updater.html#comment-form' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6985449461665670253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6985449461665670253'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/04/videos-for-my-bus-status-updater.html' title='Videos For My Bus Status Updater'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-3303217035861729451</id><published>2010-04-10T11:19:00.000-07:00</published><updated>2010-10-08T10:31:47.415-07:00</updated><title type='text'>Most Useful Mess Of Wires: GPS Bus Notifier</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U6j-XhygCUQ/S8DG957mbJI/AAAAAAAAACY/b6WGjvWU3nE/s1600/Bus+updater.JPG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 240px; height: 320px;" src="http://4.bp.blogspot.com/_U6j-XhygCUQ/S8DG957mbJI/AAAAAAAAACY/b6WGjvWU3nE/s320/Bus+updater.JPG" alt="" id="BLOGGER_PHOTO_ID_5458581515198164114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CMiles%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CMiles%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CMiles%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink 	{mso-style-priority:99; 	color:blue; 	mso-themecolor:hyperlink; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;Alright so I havent posted in a while, and the novelty of the wm+ has worn off. I dont have the funding to start a drone project right now, mainly since I’m a broke college student. And even if I did have the money, I dont think I would have the time this semester. I can barely manage to make it to classes right now. But it was from that problem that my last project took shape and has been helping me make it to my classes, making sure I dont fail out. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;A little background info first: my city (Gainesville FL) recently put gps systems in most of their busses, which can be checked from the internet. Cool huh? It partially makes up for the fact that busses follow their schedule with an error of + or - 10 minutes (for a 40 minute route). While this is great, I found myself checking the computer every 30 seconds when I woke up, or my old computer would fail to shut down properly leaving it on all day while I wasnt home, not so good for a laptop. I wanted a way to be notified of when I actually had to get my butt out of the door and head to the bus, preferably without using my computer. Well, having just started to play around with the wiznet ethernet module (which comes on the arduino ethernet shield), I decided to make this my next project. So without further ado, I present the Bus Notifier!&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I started by finding the static IP address for my bus's website, but since it is php based, the arduino obviously couldnt do anything with it. After mucking around, I found a text based version which was much more useful. The hardest parts of the project were creating a good string parsing algorithm to find just the info I wanted, and then figuring out which string tokens I wanted to make my program look for, signifying a change of state. The three states I decided upon were: nowhere near your apt, stopped somewhat close (for some reason my bus stops at one specific spot for like 10-15 minutes and just sits…yea really annoying) , and the last state is “the bus is coming, get out there!”. To allow me to know what state the bus(or busses) were in, I just used three leds, red, yellow, and green respectively. Later I added a piezo buzzer for the “get out there” state. It worked great for about three months in this state but eventually website updated and all my string parsing had to be redone. So on the next revision, I made the string parsing VERY easy to work with in case of later changes. It has been working this way every morning for the last three or so months. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Another kinda cool module I added was the ability to tweet the location of each of the busses every five minutes. I know this might seem stupid at first, but given the fact that twitter is very easy (and free) to check via text message, this allows me to check the location of the busses once I get out of class with nothing more than a “GET knuckles904” text message to twitter’s shortcode. It gives me the functionality of having a smartphone and internet plan without all the cost. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;It took a lot of work, and several revisions to get everything working right but for the past 6 months, but of all the projects Ive spent time on, this has by far been the most useful. I feel I have actually gotten a return on my time investment on this one. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;I am posting my most current code (just barely fits in a 168) below, as well as some links that are useful to see. Feel free to adapt any part of this code to your project. I am very proud of it, especially the new string searching function. Just please give credit where its due, and if possible link back here. Also as with all my other posts, any click to the “sponsors” on the right of the page is much appreciated. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://www.arduino.cc/playground/Code/TwitterLibrary"&gt;http://www.arduino.cc/playground/Code/TwitterLibrary&lt;/a&gt;&lt;span style=""&gt;             &lt;/span&gt;Makes Tweeting a cinch&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://ufl.transloc.com/"&gt;http://ufl.transloc.com/&lt;/a&gt;&lt;span style=""&gt;                               &lt;/span&gt;Gainesville’s GPS Bus website&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://ufl.transloc.com/t/"&gt;http://ufl.transloc.com/t/&lt;/a&gt;&lt;span style=""&gt;            &lt;/span&gt;Text based version&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://www.nkcelectronics.com/wiznet-wiz812mj-tcpip-network-mod812.html"&gt;http://www.nkcelectronics.com/wiznet-wiz812mj-tcpip-network-mod812.html&lt;/a&gt;&lt;span style=""&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; &lt;/span&gt;              &lt;/span&gt;Where I bought the Wiznet module&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://www.arduino.cc/en/Tutorial/TextString"&gt;http://www.arduino.cc/en/Tutorial/TextString&lt;/a&gt;&lt;span style=""&gt; &lt;/span&gt;Libraries are there to make your lives easier&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://arduiniana.org/libraries/flash/"&gt;http://arduiniana.org/libraries/flash/&lt;/a&gt;&lt;span style=""&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; &lt;/span&gt;    &lt;/span&gt;Thanks Mikal Hart for all your contributions&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a style="color: rgb(255, 0, 0);" href="http://dl.dropbox.com/u/3313470/WebClient_busStatusUpdater_forweb_pde/WebClient_busStatusUpdater_forweb_pde.pde"&gt;Dropboxed .pde of code&lt;/a&gt; I realized that the code wont necessarily work just by copy+paste, since there is embedded html in the pde. Use the scrollbox to view, and download the pde to run or modify.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-weight: bold;"&gt;CODE:&lt;/span&gt;&lt;/p&gt;&lt;code&gt;&lt;/code&gt;&lt;div style="overflow: auto; height: 600px; width: 600px;"&gt;&lt;table style="width: 250px;" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;code&gt;&lt;/code&gt;&lt;div style="overflow: auto; height: 600px; width: 400px;"&gt;&lt;br /&gt;   &lt;table style="width: 250px;" cellpadding="0" cellspacing="0"&gt;&lt;br /&gt;       &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;          &lt;td&gt;&lt;pre&gt;&lt;br /&gt;#include &lt;&lt;span style="color: rgb(204, 102, 0);"&gt;Ethernet&lt;/span&gt;.h&gt;&lt;br /&gt;#include &lt;&lt;span style="color: rgb(204, 102, 0);"&gt;WString&lt;/span&gt;.h&gt;&lt;br /&gt;#include &lt;&lt;span style="color: rgb(204, 102, 0);"&gt;Twitter&lt;/span&gt;.h&gt;&lt;br /&gt;#include &lt;&lt;span style="color: rgb(204, 102, 0);"&gt;Flash&lt;/span&gt;.h&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;byte&lt;/span&gt; mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;byte&lt;/span&gt; ip[] = { 192, 168, 1, 111 };&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;byte&lt;/span&gt; busServer[] = {66, 199, 240, 114 };&lt;br /&gt;&lt;br /&gt;#define green 3    &lt;span style="color: rgb(119, 119, 85);"&gt;//pin definitions for leds and buzzer&lt;/span&gt;&lt;br /&gt;#define yellow 4&lt;br /&gt;#define red 5&lt;br /&gt;#define buzzer 6&lt;br /&gt;&lt;br /&gt;#define clientRefresh    20000    &lt;span style="color: rgb(119, 119, 85);"&gt;//just refresh times&lt;/span&gt;&lt;br /&gt;#define buzzerRefresh    15000&lt;br /&gt;#define twitterRefresh   300000&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char yellowstr[]="SE 20th Pl";  //means bus is waiting&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char greenstr1[]="4th St";          //by itself means bus is on the move towards apt&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char greenstr2[]="State Hwy 331";  //these two must be together&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char greenstr3[]="Southwest";      //"    "  mean that bus is on the way to apt&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char tagstr[]="&lt;/span&gt;";&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char redstr1[]="SE 16th Ave";  //means that bus is already gone if contains this&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char redstr2[]="West";         //and west&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;char redstr3[]="North";        //or redstr1 and this&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String timestring(28);           &lt;span style="color: rgb(119, 119, 85);"&gt;//holding strings&lt;/span&gt;&lt;br /&gt;String bus1Locationstring(100);  &lt;span style="color: rgb(119, 119, 85);"&gt;//&lt;/span&gt;&lt;br /&gt;String bus2Locationstring(100);  &lt;span style="color: rgb(119, 119, 85);"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;String timesearch(7);&lt;span style="color: rgb(119, 119, 85);"&gt;//searching strings&lt;/span&gt;&lt;br /&gt;String busSearch(16);&lt;br /&gt;&lt;br /&gt;uint8_t connectStatus;&lt;br /&gt;uint8_t closeStatus;&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;char&lt;/span&gt; readvalue=0;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;unsigned&lt;/span&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;long&lt;/span&gt; timer1=0;  &lt;span style="color: rgb(119, 119, 85);"&gt;//client request timer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;unsigned&lt;/span&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;long&lt;/span&gt; timer2=0;  &lt;span style="color: rgb(119, 119, 85);"&gt;//client timeout timer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;unsigned&lt;/span&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;long&lt;/span&gt; timer3=0;  &lt;span style="color: rgb(119, 119, 85);"&gt;//buzzer timer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;unsigned&lt;/span&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;long&lt;/span&gt; timer4=0;  &lt;span style="color: rgb(119, 119, 85);"&gt;//twitter timer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; state=0;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;//FLASH_STRING(msg1, "i like pie");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;Client&lt;/span&gt; busClient(busServer, 80);&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;Twitter&lt;/span&gt; twitter(&lt;span style="color: rgb(204, 0, 0);"&gt;"****:****"&lt;/span&gt;);&lt;span style="color: rgb(119, 119, 85);"&gt;//see twitter library for description&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; makestring(&lt;span style="color: rgb(153, 102, 0);"&gt;char&lt;/span&gt; c, String &amp;amp;s);&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;//String getbackstring(const prog_char* str);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; &lt;span style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;setup&lt;/b&gt;&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt; initEthernet();&lt;br /&gt; timer1=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt; timer3=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt; timer4=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt; ConnectToWebserver();&lt;br /&gt; state=makestate(state);&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.print(F("Status: "));&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(state);&lt;/span&gt;&lt;br /&gt; clearstrings();&lt;br /&gt; initPins();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; &lt;span style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;loop&lt;/b&gt;&lt;/span&gt;(){&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt; ((&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;()-timer1)&gt;clientRefresh){&lt;br /&gt;     ConnectToWebserver();&lt;br /&gt;     state=makestate(state);&lt;br /&gt;     &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.print(F("Status: "));&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(state);&lt;/span&gt;&lt;br /&gt;     twitterupdate();&lt;br /&gt;     clearstrings();&lt;br /&gt;     timer1=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;switch&lt;/span&gt; (state){&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;case&lt;/span&gt; 0:&lt;br /&gt;     blink(red, 1000);&lt;br /&gt;     break;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;case&lt;/span&gt; 1:&lt;br /&gt;     turnon(green);&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;((&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;()-timer3)&gt;buzzerRefresh){&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;       timer3=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt;     }&lt;br /&gt;     break;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;case&lt;/span&gt; 2:&lt;br /&gt;     turnon(yellow);&lt;br /&gt;     break;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;case&lt;/span&gt; 3:&lt;br /&gt;     turnon(red);&lt;br /&gt;     break;&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println((millis()-timer4));&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; ConnectToWebserver(){&lt;br /&gt;&lt;br /&gt; uint8_t connectStatus;&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt; (busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;connect&lt;/span&gt;()) {&lt;br /&gt; &lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;Serial&lt;/span&gt;.&lt;span style="color: rgb(153, 102, 0);"&gt;println&lt;/span&gt;(F(&lt;span style="color: rgb(204, 0, 0);"&gt;"-Connected"&lt;/span&gt;));&lt;br /&gt; &lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// Send the HTTP GET to the server&lt;/span&gt;&lt;br /&gt;   busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;println&lt;/span&gt;(F(&lt;span style="color: rgb(204, 0, 0);"&gt;"GET /t/route.php?id=66 HTTP/1.0"&lt;/span&gt;));  &lt;span style="color: rgb(119, 119, 85);"&gt;//id=?? for php address&lt;/span&gt;&lt;br /&gt;   busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;println&lt;/span&gt;();&lt;br /&gt;&lt;br /&gt;   timer2 = &lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();          &lt;span style="color: rgb(119, 119, 85);"&gt;//secondary timer to wait up to five seconds for the server to respond&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt; ((!busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()) &amp;amp;&amp;amp; ((&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;() - timer2 ) &lt; style="color: #777755;"&gt;//loop until we either get a response or five seconds is up&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;// Read the response&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0){&lt;br /&gt;     readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;timesearch.equals(&lt;span style="color: rgb(204, 0, 0);"&gt;"&lt;small&gt;"&lt;/small&gt;&lt;/span&gt;&lt;small&gt;)==&lt;span style="color: rgb(204, 102, 0);"&gt;false&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, timesearch);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;       &lt;span style="color: rgb(119, 119, 85);"&gt;//do nothing until find timestart tag&lt;/span&gt;&lt;br /&gt;     }&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;readvalue!=&lt;span style="color: rgb(204, 0, 0);"&gt;'&lt;'&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, timestring);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;     }&lt;br /&gt;     timesearch=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;busSearch.equals(&lt;span style="color: rgb(204, 0, 0);"&gt;"&lt;div&gt;Bus 1&lt;/div&gt;"&lt;/span&gt;)==&lt;span style="color: rgb(204, 102, 0);"&gt;false&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, busSearch);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;       &lt;span style="color: rgb(119, 119, 85);"&gt;//do nothing until find bus1start tag&lt;/span&gt;&lt;br /&gt;     }&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;readvalue!=&lt;span style="color: rgb(204, 0, 0);"&gt;'&lt;'&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, bus1Locationstring);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;     }&lt;br /&gt;     busSearch=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;busSearch.equals(&lt;span style="color: rgb(204, 0, 0);"&gt;"&lt;div&gt;Bus 2&lt;/div&gt;"&lt;/span&gt;)==&lt;span style="color: rgb(204, 102, 0);"&gt;false&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, busSearch);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;       &lt;span style="color: rgb(119, 119, 85);"&gt;//do nothing until find bus2start tag&lt;/span&gt;&lt;br /&gt;     }&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;while&lt;/span&gt;(busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;available&lt;/span&gt;()&gt;0&amp;amp;&amp;amp;readvalue!=&lt;span style="color: rgb(204, 0, 0);"&gt;'&lt;'&lt;/span&gt;){&lt;br /&gt;       makestring(readvalue, bus2Locationstring);&lt;br /&gt;       readvalue=busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;read&lt;/span&gt;();&lt;br /&gt;     }&lt;br /&gt;     busSearch=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    if(!timestring.equals("")){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      //Serial.println(timestring);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    if(!bus1Locationstring.equals("")){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      //Serial.println(bus1Locationstring);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    if(!bus2Locationstring.equals("")){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      //Serial.println(bus2Locationstring);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;      &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    }*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// Disconnect from the server&lt;/span&gt;&lt;br /&gt;   busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;flush&lt;/span&gt;();&lt;br /&gt;   busClient.&lt;span style="color: rgb(153, 102, 0);"&gt;stop&lt;/span&gt;();&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(F("Connection ended"));&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; {&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// Connection failed&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(F(" - CONNECTION FAILED!"));&lt;/span&gt;&lt;br /&gt;   timer1=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; makestate(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; state){&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(((bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"4th St"&lt;/span&gt;)&amp;amp;&amp;amp;!bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"1"&lt;/span&gt;))||(bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"State Hwy 331"&lt;/span&gt;)&amp;amp;&amp;amp;bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"Southwest"&lt;/span&gt;)))||&lt;br /&gt;    ((bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"4th St"&lt;/span&gt;)&amp;amp;&amp;amp;!bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"1"&lt;/span&gt;))||(bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"State Hwy 331"&lt;/span&gt;)&amp;amp;&amp;amp;bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"Southwest"&lt;/span&gt;)))){&lt;br /&gt;   state=1;&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 20th Pl"&lt;/span&gt;)||bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 20th Pl"&lt;/span&gt;)){&lt;br /&gt;   state=2;&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;( ( (bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 16th Ave"&lt;/span&gt;)&amp;amp;&amp;amp;bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"West"&lt;/span&gt;)) || (bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 16th Ave"&lt;/span&gt;)&amp;amp;&amp;amp;bus1Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"North"&lt;/span&gt;)) )||&lt;br /&gt;          ( (bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 16th Ave"&lt;/span&gt;)&amp;amp;&amp;amp;bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"West"&lt;/span&gt;)) || (bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"SE 16th Ave"&lt;/span&gt;)&amp;amp;&amp;amp;bus2Locationstring.contains(&lt;span style="color: rgb(204, 0, 0);"&gt;"North"&lt;/span&gt;)) )  ){&lt;br /&gt;   state=3;&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;return&lt;/span&gt; state;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; makestring(&lt;span style="color: rgb(153, 102, 0);"&gt;char&lt;/span&gt; inChar, String &amp;amp;inString) {&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; maxLength=inString.capacity();&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;// read the incoming data as a char:&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;// if you're not at the end of the string, append&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;// the incoming character:&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt; (inString.&lt;span style="color: rgb(153, 102, 0);"&gt;length&lt;/span&gt;() &lt; style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; {      &lt;span style="color: rgb(119, 119, 85);"&gt;//rolling string, taking out the first char and putting in a new one at the end&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;for&lt;/span&gt;(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; i=0;i&lt;maxlength-1;i++){&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; buzz(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; period, &lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; number){&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; i=0;i&lt;number;&gt;&lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(buzzer, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;delayMicroseconds&lt;/span&gt;(period/2);&lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(buzzer, &lt;span style="color: rgb(204, 0, 0);"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;delayMicroseconds&lt;/span&gt;(period/2);&lt;br /&gt; }&lt;br /&gt;}&lt;span style="color: rgb(119, 119, 85);"&gt;//we use 1000,100 for now&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; blink(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; pin, &lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; duration){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(pin, &lt;span style="color: rgb(204, 0, 0);"&gt;HIGH&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(duration/2);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(pin, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(duration/2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; initEthernet(){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;pinMode&lt;/span&gt;(8, &lt;span style="color: rgb(204, 0, 0);"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(8, &lt;span style="color: rgb(204, 0, 0);"&gt;HIGH&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(100);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(8, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(100);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(8, &lt;span style="color: rgb(204, 0, 0);"&gt;HIGH&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(5000);&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;Ethernet&lt;/span&gt;.&lt;span style="color: rgb(153, 102, 0);"&gt;begin&lt;/span&gt;(mac, ip);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;Serial&lt;/span&gt;.&lt;span style="color: rgb(153, 102, 0);"&gt;begin&lt;/span&gt;(115200);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;Serial&lt;/span&gt;.&lt;span style="color: rgb(153, 102, 0);"&gt;print&lt;/span&gt;(F(&lt;span style="color: rgb(204, 0, 0);"&gt;"Start"&lt;/span&gt;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; initPins(){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;pinMode&lt;/span&gt;(green, &lt;span style="color: rgb(204, 0, 0);"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;pinMode&lt;/span&gt;(yellow, &lt;span style="color: rgb(204, 0, 0);"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;pinMode&lt;/span&gt;(red, &lt;span style="color: rgb(204, 0, 0);"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;pinMode&lt;/span&gt;(buzzer, &lt;span style="color: rgb(204, 0, 0);"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(green, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(yellow, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(red, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; clearstrings(){&lt;br /&gt; timestring=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt; bus1Locationstring=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt; bus2Locationstring=&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; turnon(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; pin){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(green, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(yellow, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(red, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(pin, &lt;span style="color: rgb(204, 0, 0);"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; turnoff(){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(green, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(yellow, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;digitalWrite&lt;/span&gt;(red, &lt;span style="color: rgb(204, 0, 0);"&gt;LOW&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; twitterpost(&lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; busnumber){&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;boolean&lt;/span&gt; good=0;&lt;br /&gt; &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(F("connecting ..."));&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(busnumber==1){&lt;br /&gt;   good=twitter.&lt;span style="color: rgb(153, 102, 0);"&gt;post&lt;/span&gt;(bus1Locationstring);&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(busnumber==2){&lt;br /&gt;   good=twitter.&lt;span style="color: rgb(153, 102, 0);"&gt;post&lt;/span&gt;(bus2Locationstring);&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt; (good) {&lt;br /&gt;   &lt;span style="color: rgb(153, 102, 0);"&gt;int&lt;/span&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;status&lt;/span&gt; = twitter.&lt;span style="color: rgb(153, 102, 0);"&gt;wait&lt;/span&gt;();&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(153, 102, 0);"&gt;status&lt;/span&gt; == 200) {&lt;br /&gt;     &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(F("OK.1"));&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; {&lt;br /&gt;     &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.print(F("failed : code "));&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(status);&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt; {&lt;br /&gt;   &lt;span style="color: rgb(119, 119, 85);"&gt;//Serial.println(F("connection failed."));&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt; twitter.&lt;span style="color: rgb(153, 102, 0);"&gt;stop&lt;/span&gt;();&lt;br /&gt; &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1000);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;void&lt;/span&gt; twitterupdate(){&lt;br /&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;((&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;()-timer4)&gt;twitterRefresh){&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(!bus1Locationstring.equals(&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;)){&lt;br /&gt;       twitterpost(1);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;       &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1000);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;       &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1000);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;     }&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 0);"&gt;if&lt;/span&gt;(!bus2Locationstring.equals(&lt;span style="color: rgb(204, 0, 0);"&gt;""&lt;/span&gt;)){&lt;br /&gt;       twitterpost(2);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;       &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1000);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;       &lt;span style="color: rgb(153, 102, 0);"&gt;delay&lt;/span&gt;(1000);&lt;br /&gt;       buzz(1000, 100);&lt;br /&gt;     }&lt;br /&gt;     timer4=&lt;span style="color: rgb(153, 102, 0);"&gt;millis&lt;/span&gt;();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;String getbackstring(const prog_char* str){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  String tempstring(30);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  //str.copy(tempstring, str.length());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  return tempstring;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;/*                  //this whole sketch is based on the new ethernet client example&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;int ReadResponse(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  int totalBytes=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  unsigned long timer2 = millis();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// First wait up to 5 seconds for the server to return some data.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// If we don't have this initial timeout period we might try to&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// read the data "too quickly" before the server can generate the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;// response to the request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  while ((!busClient.available()) &amp;amp;&amp;amp; ((millis() - timer2 ) &lt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  while (busClient.available()) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    char c = busClient.read();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    Serial.print(c);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;    totalBytes+=1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;  return totalBytes;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(119, 119, 85);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/number;&gt;&lt;/maxlength-1;i++){&gt;&lt;/small&gt;&lt;/pre&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-3303217035861729451?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/3303217035861729451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/04/most-useful-mess-of-wires-gps-bus.html#comment-form' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/3303217035861729451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/3303217035861729451'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/04/most-useful-mess-of-wires-gps-bus.html' title='Most Useful Mess Of Wires: GPS Bus Notifier'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U6j-XhygCUQ/S8DG957mbJI/AAAAAAAAACY/b6WGjvWU3nE/s72-c/Bus+updater.JPG' height='72' width='72'/><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-2253890051849156263</id><published>2010-02-15T14:58:00.000-08:00</published><updated>2010-02-15T15:18:05.285-08:00</updated><title type='text'>WM+ update long overdue</title><content type='html'>Well I havent posted here for a while, but I do have many updates for a couple different projects. I never ended up getting full kalman filtering to work between the wm+, nunchuck, and arduino, but there have been a few other, maybe better things. First, my transistor method is no longer needed to interface the wm+ and the nunchuck at the same time. Pass thru mode has been discovered and is described (krulkip) in this post: &lt;a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248889032/45"&gt;http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248889032/45&lt;/a&gt; . Second, the kalman method has been mostly abandoned on the arduino platform, and in its place two options have surfaced.&lt;br /&gt;1. Complimentary filtering as seen &lt;a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253202298"&gt;here &lt;/a&gt;.&lt;br /&gt;2. Direction Cosine Matrix. Not implemented with wii peripherals but easily enough ported. Tons of information over at &lt;a href="http://diydrones.com/"&gt;diydrones.com&lt;/a&gt; . Much less computationally intense and more suited to a microcontroller like the arduino.&lt;br /&gt;&lt;br /&gt;Good luck on all your projects!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-2253890051849156263?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/2253890051849156263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/02/wm-update-long-overdue.html#comment-form' title='27 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/2253890051849156263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/2253890051849156263'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2010/02/wm-update-long-overdue.html' title='WM+ update long overdue'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><thr:total>27</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-6994702274276735447</id><published>2009-07-26T16:33:00.000-07:00</published><updated>2009-07-26T22:03:14.299-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='atmega'/><category scheme='http://www.blogger.com/atom/ns#' term='microcontroller'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='uav'/><category scheme='http://www.blogger.com/atom/ns#' term='Plus'/><category scheme='http://www.blogger.com/atom/ns#' term='nunchuck'/><category scheme='http://www.blogger.com/atom/ns#' term='imu'/><category scheme='http://www.blogger.com/atom/ns#' term='gyro'/><category scheme='http://www.blogger.com/atom/ns#' term='Motion'/><category scheme='http://www.blogger.com/atom/ns#' term='avr'/><category scheme='http://www.blogger.com/atom/ns#' term='motionplus'/><category scheme='http://www.blogger.com/atom/ns#' term='nintendo'/><category scheme='http://www.blogger.com/atom/ns#' term='accelerometer'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='Wii'/><title type='text'>Motion Plus and Nunchuck together on the Arduino</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U6j-XhygCUQ/Sm0UGK05VUI/AAAAAAAAABs/wzyl9nLX5-0/s1600-h/P1030135.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_U6j-XhygCUQ/Sm0UGK05VUI/AAAAAAAAABs/wzyl9nLX5-0/s320/P1030135.JPG" alt="" id="BLOGGER_PHOTO_ID_5362964827486115138" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;Easy as 1-2-3&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Alright, one great aspect about the Wii Motion Plus is its pass through port for other extension controllers such as the nunchuck. Unfortunately, no one has been able to read both an active motion plus and any other controller at the same time because they are all on the same I2C address(smooth nintendo). This is creates a large hurdle to people like myself who bought the WM+ to create a low cost IMU with it and the accelerometer in the nunchuck. After a good deal of digging and very little luck, I did find a way to use both at the same time(though not through the pass through port). And best of all its cheap!&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Note before continuing: &lt;/span&gt;Please remember that I am disclosing this method free of cost in the spirit of open sourciness. As such, if you read this and it helps you, please help me a little by clicking on one(or more) of the ads to the side. It will help me out(monetarily) and let me feel like Ive gotten a little back for publishing it instead of keeping it to myself. Dont worry, they wont bite (theyre google ads).&lt;br /&gt;&lt;br /&gt;Credit where credit is due: I got the idea from&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;a href="http://www.wiimoteproject.com/tech-chat/2-nunchuck-with-arduino-help/"&gt;this post,&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; so many thanks johnnyonthespot&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Materials:&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 102, 51);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(204, 153, 51);font-size:85%;" &gt;2 NPN type switching transistors (I used 2N2222-super easy to find)&lt;br /&gt;2 current limiting resistors (I used 470 Ohm)&lt;br /&gt;Breadboard and jumper wires or make your own board&lt;br /&gt;&lt;br /&gt;All of these materials can be easily and very cheaply bought at radioshack, mouser,  digikey, or the like.&lt;br /&gt;Literally, it will cost like $4.00 if you already have a breadboard&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(153, 102, 51);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Rigging it Up:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Here is a simple schematic for breadboarding:&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(153, 102, 51);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U6j-XhygCUQ/Smz4lYGI4GI/AAAAAAAAAA8/7Mf94Od-Iqs/s1600-h/WM%2B+2.bmp"&gt;&lt;img style="cursor: pointer; width: 320px; height: 246px;" src="http://4.bp.blogspot.com/_U6j-XhygCUQ/Smz4lYGI4GI/AAAAAAAAAA8/7Mf94Od-Iqs/s320/WM%2B+2.bmp" alt="" id="BLOGGER_PHOTO_ID_5362934577298464866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Code:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);font-size:85%;" &gt;#include &amp;#60;Wire.h&amp;#62;&lt;br /&gt;#include &amp;#60;Streaming.h&amp;#62;&lt;br /&gt;&lt;br /&gt;//WM+ stuff&lt;br /&gt;byte data[6];          //six data bytes&lt;br /&gt;int yaw, pitch, roll;  //three axes&lt;br /&gt;int yaw0, pitch0, roll0;  //calibration zeroes&lt;br /&gt;&lt;br /&gt;//nunchuck stuff&lt;br /&gt;uint8_t outbuf[6];        // array to store arduino output&lt;br /&gt;int cnt = 0;&lt;br /&gt;int joy_x_axis, joy_y_axis, accel_x_axis, accel_y_axis, accel_z_axis;&lt;br /&gt;boolean z_button, c_button;&lt;br /&gt;&lt;br /&gt;void setup(){&lt;br /&gt;  Serial.begin(115200);&lt;br /&gt;  Serial &lt;&lt; "WM+ and Nunchuck tester" &lt;&lt; endl;&lt;br /&gt;  pinMode(3, OUTPUT);&lt;br /&gt;  pinMode(4, OUTPUT);&lt;br /&gt;  digitalWrite(3, HIGH);&lt;br /&gt;  digitalWrite(4, HIGH);&lt;br /&gt;  Wire.begin();&lt;br /&gt;  switchtowmp();&lt;br /&gt;  wmpOn();&lt;br /&gt;  calibrateZeroes();&lt;br /&gt;  switchtonunchuck();&lt;br /&gt;  nunchuck_init();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop(){&lt;br /&gt;  switchtowmp();&lt;br /&gt;  receiveData();&lt;br /&gt;  //receiveRaw();&lt;br /&gt;  switchtonunchuck();&lt;br /&gt;  receive_nunchuck_data();&lt;br /&gt;  Serial &lt;&lt; yaw &lt;&lt; "\t" &lt;&lt; pitch &lt;&lt; "\t" &lt;&lt; roll &lt;&lt; "\t" &lt;&lt; joy_x_axis &lt;&lt; "\t" &lt;&lt; joy_y_axis &lt;&lt; "\t";&lt;br /&gt;  Serial &lt;&lt; accel_x_axis &lt;&lt; "\t" &lt;&lt; accel_y_axis &lt;&lt; "\t" &lt;&lt; accel_z_axis;&lt;br /&gt;  Serial &lt;&lt; "\t" &lt;&lt; _DEC(z_button) &lt;&lt; "\t" &lt;&lt; _DEC(c_button) &lt;&lt; endl;&lt;br /&gt;  delay(100);  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void nunchuck_init ()&lt;br /&gt;{&lt;br /&gt;  Wire.beginTransmission (0x52);// transmit to device 0x52&lt;br /&gt;  Wire.send (0x40);        // sends memory address&lt;br /&gt;  Wire.send (0x00);        // sends sent a zero. &lt;br /&gt;  Wire.endTransmission ();    // stop transmitting&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void send_zero ()&lt;br /&gt;{&lt;br /&gt;  Wire.beginTransmission (0x52);// transmit to device 0x52&lt;br /&gt;  Wire.send (0x00);        // sends one byte&lt;br /&gt;  Wire.endTransmission ();    // stop transmitting&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void receive_nunchuck_data(){&lt;br /&gt;  Wire.requestFrom(0x52, 6);&lt;br /&gt;  for (int i=0;i&lt;6;i++){&lt;br /&gt;    data[i]=Wire.receive();&lt;br /&gt;  }&lt;br /&gt;  make_nunchuck_data();&lt;br /&gt;  send_zero();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void make_nunchuck_data ()&lt;br /&gt;{&lt;br /&gt;  for(int i=0;i&lt;6;i++){&lt;br /&gt;    outbuf[i]=nunchuck_decode_byte(data[i]);&lt;br /&gt;  }&lt;br /&gt;  joy_x_axis = outbuf[0];&lt;br /&gt;  joy_y_axis = outbuf[1];&lt;br /&gt;  accel_x_axis = outbuf[2] * 2 * 2;&lt;br /&gt;  accel_y_axis = outbuf[3] * 2 * 2;&lt;br /&gt;  accel_z_axis = outbuf[4] * 2 * 2;&lt;br /&gt;  z_button = 0;&lt;br /&gt;  c_button = 0;&lt;br /&gt;&lt;br /&gt; // byte outbuf[5] contains bits for z and c buttons&lt;br /&gt; // it also contains the least significant bits for the accelerometer data&lt;br /&gt; // so we have to check each bit of byte outbuf[5]&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 0) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      z_button = 1;&lt;br /&gt;    }&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 1) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      c_button = 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 2) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_x_axis += 2;&lt;br /&gt;    }&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 3) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_x_axis += 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 4) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_y_axis += 2;&lt;br /&gt;    }&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 5) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_y_axis += 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 6) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_z_axis += 2;&lt;br /&gt;    }&lt;br /&gt;  if ((outbuf[5] &gt;&gt; 7) &amp;amp; 1)&lt;br /&gt;    {&lt;br /&gt;      accel_z_axis += 1;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;char nunchuck_decode_byte (char x)&lt;br /&gt;{&lt;br /&gt;  x = (x ^ 0x17) + 0x17;&lt;br /&gt;  return x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void wmpOn(){&lt;br /&gt;  Wire.beginTransmission(0x53);//WM+ starts out deactivated at address 0x53&lt;br /&gt;  Wire.send(0xfe);             //send 0x04 to address 0xFE to activate WM+&lt;br /&gt;  Wire.send(0x04);&lt;br /&gt;  Wire.endTransmission();      //WM+ jumps to address 0x52 and is now active&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void wmpOff(){&lt;br /&gt;  Wire.beginTransmission(82);&lt;br /&gt;  Wire.send(0xf0);//address then&lt;br /&gt;  Wire.send(0x55);//command&lt;br /&gt;  //Wire.send(0x00);&lt;br /&gt;  //Wire.send(0xfb);&lt;br /&gt;  Wire.endTransmission();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void wmpSendZero(){&lt;br /&gt;  Wire.beginTransmission(0x52);//now at address 0x52&lt;br /&gt;  Wire.send(0x00);             //send zero to signal we want info&lt;br /&gt;  Wire.endTransmission();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void calibrateZeroes(){&lt;br /&gt;  for (int i=0;i&lt;10;i++){&lt;br /&gt;    wmpSendZero();&lt;br /&gt;    Wire.requestFrom(0x52,6);&lt;br /&gt;    for (int i=0;i&lt;6;i++){&lt;br /&gt;      data[i]=Wire.receive();&lt;br /&gt;    }&lt;br /&gt;    yaw0+=(((data[3] &gt;&gt; 2) &lt;&lt; 8)+data[0])/10;//average 10 readings&lt;br /&gt;    pitch0+=(((data[4] &gt;&gt; 2) &lt;&lt; 8)+data[1])/10;// for each zero&lt;br /&gt;    roll0+=(((data[5] &gt;&gt; 2) &lt;&lt; 8)+data[2])/10;&lt;br /&gt;  }&lt;br /&gt;  Serial.print("Yaw0:");&lt;br /&gt;  Serial.print(yaw0);&lt;br /&gt;  Serial.print("  Pitch0:");&lt;br /&gt;  Serial.print(pitch0);&lt;br /&gt;  Serial.print("  Roll0:");&lt;br /&gt;  Serial.println(roll0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void receiveData(){&lt;br /&gt;  wmpSendZero();               //send zero before each request (same as nunchuck)&lt;br /&gt;  Wire.requestFrom(0x52,6);    //request the six bytes from the WM+&lt;br /&gt;  for (int i=0;i&lt;6;i++){&lt;br /&gt;    data[i]=Wire.receive();&lt;br /&gt;  }&lt;br /&gt;  //see http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Wii_Motion_Plus&lt;br /&gt;  //for info on what each byte represents&lt;br /&gt;  yaw=((data[3] &gt;&gt; 2) &lt;&lt; 8)+data[0]-yaw0;  &lt;br /&gt;  pitch=((data[4] &gt;&gt; 2) &lt;&lt; 8)+data[1]-pitch0;&lt;br /&gt;  roll=((data[5] &gt;&gt; 2) &lt;&lt; 8)+data[2]-roll0;    &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void receiveRaw(){&lt;br /&gt;  wmpSendZero();           //send zero before each request (same as nunchuck)&lt;br /&gt;  Wire.requestFrom(0x52,6);//request the six bytes from the WM+&lt;br /&gt;  for (int i=0;i&lt;6;i++){&lt;br /&gt;    data[i]=Wire.receive();&lt;br /&gt;  }&lt;br /&gt;  yaw=((data[3] &gt;&gt; 2) &lt;&lt; 8)+data[0];&lt;br /&gt;  pitch=((data[4] &gt;&gt; 2) &lt;&lt; 8)+data[1];&lt;br /&gt;  roll=((data[5] &gt;&gt; 2) &lt;&lt; 8)+data[2];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void switchtonunchuck(){&lt;br /&gt;  digitalWrite(3, LOW);&lt;br /&gt;  digitalWrite(4, LOW);&lt;br /&gt;  digitalWrite(4, HIGH);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void switchtowmp(){&lt;br /&gt;  digitalWrite(3, LOW);&lt;br /&gt;  digitalWrite(4, LOW);&lt;br /&gt;  digitalWrite(3, HIGH);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;Closing Comments&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;If some of this code looks wierd to you its probably the streaming operator(&lt;&lt;). I prefer to use this form from mikalhart's &lt;a href="http://arduiniana.org/libraries/streaming/"&gt;streaming library&lt;/a&gt;. If you dont like it or dont want to download it, just replace any &lt;&lt; with a .print() of the type specified before the &lt;&lt; operator (ex: Serial &lt;&lt; "hi" &lt;&lt; endl;  is the same as Serial.print("hi"); Serial.println(); )&lt;br /&gt;&lt;br /&gt;Also remember to reference the definitions of the axes for each sensor; yaw, pitch, and roll are not the same for both, nor are they necessarily what I would have picked them to be. Im just keeping with what prior work has named them. Also, if you want a full fledged IMU from these components, stay tuned. I should have a decent&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt; kalman filtered IMU demo c&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;oming soon. Woot!&lt;br /&gt;&lt;br /&gt;Lastly, I find the Arduino.cc forum to be much better at handling questions so try to reach me there on my post in the &lt;a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245723011/30#30"&gt;exhibition&lt;/a&gt; section if your comment here doesnt get answered.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-6994702274276735447?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/6994702274276735447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2009/07/motion-plus-and-nunchuck-together-on.html#comment-form' title='46 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6994702274276735447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/6994702274276735447'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2009/07/motion-plus-and-nunchuck-together-on.html' title='Motion Plus and Nunchuck together on the Arduino'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U6j-XhygCUQ/Sm0UGK05VUI/AAAAAAAAABs/wzyl9nLX5-0/s72-c/P1030135.JPG' height='72' width='72'/><thr:total>46</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2195458173067627156.post-4749484583995800106</id><published>2009-06-22T13:55:00.000-07:00</published><updated>2009-06-22T19:59:13.758-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM+'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='Plus'/><category scheme='http://www.blogger.com/atom/ns#' term='Motion'/><category scheme='http://www.blogger.com/atom/ns#' term='motionplus'/><category scheme='http://www.blogger.com/atom/ns#' term='nunchuck'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='Wii'/><title type='text'>Wii Motion Plus + Arduino = Love</title><content type='html'>&lt;span style="font-size:100%;"&gt;Ok so I, after much research, have been able to read the gyro data of the new wii motion plus peripheral with the arduino microcontroller. With this code and the code previously developed for the wii nunchuck (&lt;a href="http://www.windmeadow.com/node/42"&gt;here&lt;/a&gt;), we are able to create a 6 DOF IMU for under $40. Thanks Nintendo! Best of all, everything is I2C so only 2 analog inputs (A4 and A5 needed for the wire library) are needed to read 6 sensors and no ADC conversion happens on the arduino board.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;Links and Thanks:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;First off, I'm going to link(and thank) a few sites that have helped me immensely with this undertaking:&lt;br /&gt;&lt;a href="http://www.arduino.cc/"&gt;Arduino.cc&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.windmeadow.com/node/42"&gt;original nunchuck code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Wii_Motion_Plus"&gt;Wii brew WM+ info&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.parallax.com/forums/default.aspx?f=25&amp;amp;m=361456"&gt;Propeller forums&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(51, 255, 51);font-family:georgia;" &gt;Hardware connections:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;I used full 5V TTL signals and power and have had no problems thus far (a week going strong) but if you have a 3.3v arduino or a level converter and 3.3v regulator, i would suggest that over a 5v connection. Furthermore, twi.h under the wire library does not need to be changed for my setup but might under some setups. Start with the default 100khz TWI_FREQ and if that doesnt work, use 400khz. Websites disagree about which is the proper speed for direct I2C on wii peripherals. Connections to WM+ are same as nunchuck and look like this:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style="font-size:100%;"&gt;| 1 2 3 |&lt;br /&gt;|       |&lt;br /&gt;| 6 5 4 |&lt;br /&gt;|_-----_|&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;1 - green - data&lt;br /&gt;2 - nothing&lt;br /&gt;3 - red - 3.3+v&lt;br /&gt;4 - yellow - clock&lt;br /&gt;5 - nothing&lt;br /&gt;6 - white - ground &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;So its pin 3 to 5v, 6 to ground, 1 to A4, and 4 to A5&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Adapters such as the one sold &lt;a href="http://store.fungizmos.com/index.php?main_page=product_info&amp;amp;cPath=69&amp;amp;products_id=212"&gt;here&lt;/a&gt; should (theoretically) work; I use jumper wires and hot glue&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 204, 0);"&gt;&lt;span style="font-size:130%;"&gt;Software:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;I have commented the demo code pretty well so it should be easy to follow, if not comment here or on Arduino.cc Forums-&gt;Exhibition&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;wire.h&gt;&lt;/wire.h&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;#include &amp;#60;Wire.h&amp;#62;&lt;wire.h&gt;&lt;/wire.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;byte data[6];          //six data bytes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;int yaw, pitch, roll;  //three axes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;int yaw0, pitch0, roll0;  //calibration zeroes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void wmpOn(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.beginTransmission(0x53);    //WM+ starts out deactivated at address 0x53&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.send(0xfe);                 //send 0x04 to address 0xFE to activate WM+&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.send(0x04);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.endTransmission();          //WM+ jumps to address 0x52 and is now active&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void wmpSendZero(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.beginTransmission(0x52);    //now at address 0x52&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.send(0x00);                 //send zero to signal we want info&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.endTransmission();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void calibrateZeroes(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  for (int i=0;i&lt;10;i++){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    wmpSendZero();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    Wire.requestFrom(0x52,6);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    for (int i=0;i&lt;6;i++){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;      data[i]=Wire.receive();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    &lt;span style="color: rgb(51, 255, 255);"&gt; yaw0+=(((data[3]&gt;&gt;2)&lt;&lt;8)+data[0])/10; //average 10 readings&lt;br /&gt;pitch0+=(((data[4]&gt;&gt;2)&lt;&lt;8)+data[1])/10;&lt;br /&gt;roll0+=(((data[5]&gt;&gt;2)&lt;&lt;8)+data[2])/10;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("Yaw0:");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print(yaw0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("  Pitch0:");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print(pitch0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("  Roll0:");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.println(roll0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void receiveData(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  wmpSendZero();                   //send zero before each request (same as nunchuck)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.requestFrom(0x52,6);        //request the six bytes from the WM+&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  for (int i=0;i&lt;6;i++){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;    data[i]=Wire.receive();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  &lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;/span&gt;yaw=((data[3]&gt;&gt;2)&lt;&lt;8)+data[0]-yaw0;      &lt;br /&gt;pitch=((data[4]&gt;&gt;2)&lt;&lt;8)+data[1]-pitch0;  &lt;br /&gt;roll=((data[5]&gt;&gt;2)&lt;&lt;8)+data[2]-roll0;    &lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;//see http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Wii_Motion_Plus&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;//for info on what each byte represents&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void setup(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.begin(115200);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.println("WM+ tester");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Wire.begin();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  wmpOn();                        //turn WM+ on&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  calibrateZeroes();              //calibrate zeroes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  delay(1000);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;void loop(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  receiveData();       //receive data and calculate yaw pitch and roll&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("yaw:");//see diagram on randomhacksofboredom.blogspot.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print(yaw);   //for info on which axis is which&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("  pitch:");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print(pitch);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.print("  roll:");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  Serial.println(roll);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;  delay(100);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;Orientation:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;&lt;span style="color: rgb(204, 255, 255);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Sorry for the arrows being all in the negative direction. Picture was done quickly. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://tinypic.com/" target="_blank"&gt;&lt;img src="http://i39.tinypic.com/1zxryax.jpg" alt="Image and video hosting by TinyPic" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;ENJOY!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2195458173067627156-4749484583995800106?l=randomhacksofboredom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomhacksofboredom.blogspot.com/feeds/4749484583995800106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://randomhacksofboredom.blogspot.com/2009/06/wii-motion-plus-arduino-love.html#comment-form' title='444 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/4749484583995800106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2195458173067627156/posts/default/4749484583995800106'/><link rel='alternate' type='text/html' href='http://randomhacksofboredom.blogspot.com/2009/06/wii-motion-plus-arduino-love.html' title='Wii Motion Plus + Arduino = Love'/><author><name>knuckles904</name><uri>http://www.blogger.com/profile/00938378033605277455</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://2.bp.blogspot.com/_U6j-XhygCUQ/TNAx5_MwqxI/AAAAAAAAACs/6-ef56Fy_fc/S220/coelogo.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i39.tinypic.com/1zxryax_th.jpg' height='72' width='72'/><thr:total>444</thr:total></entry></feed>
