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

<channel>
	<title>RobotGrrl.com &#187; COSI</title>
	<atom:link href="http://robotgrrl.com/blog/tag/cosi/feed/" rel="self" type="application/rss+xml" />
	<link>http://robotgrrl.com/blog</link>
	<description>ethical robots that bring smiles</description>
	<lastBuildDate>Mon, 20 May 2013 03:42:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple Processing Twitter</title>
		<link>http://robotgrrl.com/blog/2011/02/21/simple-processing-twitter/</link>
		<comments>http://robotgrrl.com/blog/2011/02/21/simple-processing-twitter/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 18:13:00 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Access Token]]></category>
		<category><![CDATA[Consumer Key]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter4j]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1830</guid>
		<description><![CDATA[I created a really simple Processing and Twitter sketch to help a friend a few nights ago ^_^ It is based off of this previous code from the blog post &#8220;Processing + Arduino + Twitter + OAuth&#8221;. Here&#8217;s what changed: - It now uses the Access Token that you can get from the Twitter App&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I created a really simple Processing and Twitter sketch to help a friend a few nights ago ^_^ It is based off of this previous code from the blog post <a href="http://robotgrrl.com/blog/2010/09/15/processing-arduino-twitter-oauth/">&#8220;Processing + Arduino + Twitter + OAuth&#8221;</a>. Here&#8217;s what changed: </p>
<p>- It now uses the Access Token that you can get from the Twitter App&#8217;s panel<br />
- No more inserting PIN info into a file<br />
- No Arduino clutter in the sketch<br />
- Simple methods for posting, retrieving, and searching tweets.</p>
<p>You can probably do a lot more things with this too, thanks to Twitter4j.</p>
<p><center><a href="https://github.com/RobotGrrl/Simple-Processing-Twitter/zipball/master"><img src="http://robotgrrl.com/processing/processing-icon-small.png" /></a></center></p>
<p><center><a href="https://github.com/RobotGrrl/Simple-Processing-Twitter/zipball/master">Click to download SimpleProcessingTwitter.pde</a><br />
Or <a href="https://github.com/RobotGrrl/Simple-Processing-Twitter">view it on Github</a><br />
</center></p>
<p>If you use this code in one of your projects, let me know! It is cool to see what people make. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr />
<center><br />
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>. GO OPEN SOURCE!<br />
</center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Simple+Processing+Twitter+http%3A%2F%2Fis.gd%2FGyOBjH+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2011/02/21/simple-processing-twitter/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Helpless Personal Robots</title>
		<link>http://robotgrrl.com/blog/2011/01/16/helpless-personal-robots/</link>
		<comments>http://robotgrrl.com/blog/2011/01/16/helpless-personal-robots/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 19:19:30 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Deep Thought]]></category>
		<category><![CDATA[conversation]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[deep thought]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[helpless]]></category>
		<category><![CDATA[personable robots]]></category>
		<category><![CDATA[robot uprising]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[sentient]]></category>
		<category><![CDATA[social intelligence]]></category>
		<category><![CDATA[social knowledge]]></category>
		<category><![CDATA[social robotics]]></category>
		<category><![CDATA[society]]></category>
		<category><![CDATA[survival]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1803</guid>
		<description><![CDATA[Helpless Personal Robots A deep thought, by RobotGrrl Imagine we have determined the magical ratio between appearance, intelligence, and social knowledge for personable robots to be accepted in our society.[1] They have the ability to have a fulfilling conversation at tea time with you, they can walk, they look polished, and they can understand social [...]]]></description>
			<content:encoded><![CDATA[<div class="deepthought">
<h1>Helpless Personal Robots</h1>
<h6>A deep thought, by RobotGrrl</h6>
<p>Imagine we have determined the magical ratio between appearance, intelligence, and social knowledge for personable robots to be accepted in our society.[1] They have the ability to have a fulfilling conversation at tea time with you, they can walk, they look polished, and they can understand social norms in cultures. They are the perfect personable robots. </p>
<p>When these robots are rolling off the assembly line, they do not have any social intelligence. The designers of the robots decided it is better to immerse them in an environment where they can learn about the culture for their area. This decision allows for a more focussed personal robot.</p>
<p>A more focussed personal robot would spare no computer cycles and memory on knowledge that would not be utilized in its designated surrounding environment. Tuned to the social dynamics of the area, the robot will be able to speak the proper language and dialects and it would be aware of the historic weather patterns, for both survival purposes and conversation. Depending on how educated the area is, the robot’s style of reasoning will differ. The style of reasoning that the robot would use would effect how it converses and behaves in society. We want the robot to stand out as little as possible, thereby adapting to the environment is crucial.</p>
<p>In order to properly embed the robot with this customized social intelligence, they have to be trained to behave the proper way. The social intelligence cannot come pre-programmed because of the complex nature of the knowledge to be learnt. It is not a large number of facts, rather it is a pattern of behaviour that the robot must learn. In order to be trained for the patterns, the robots will learn from previous similarly tuned robots.[2]</p>
<p>Imagine there are a couple of robots playing the “teacher” role, and a group of robot “students”. The students have to be taught about the culture an behaviour patterns. The only way to learn this material is through repetition followed by a &#8220;quiz&#8221;, resulting in a reward or punishment[3]. Due to the pace of the robots, the complete training would only take 1-2 weeks, at most.</p>
<p>During this time, the robots are gaining more social intelligence, they are also becoming more aware about the ethics of the surroundings. Their reaction to this new found awareness will differ in every robot, since every robot is in a different progress towards being fully trained. </p>
<p>Their reaction will also depend on how strict the teacher robots are, and how flexible they are to be understanding of the robots concerns. If the teacher robots are extremely strict, and make the robot feel it is not of will[4] to be there, as if they are forced to be there. After seeing that they have to behave in a certain way, they may not be able to understand that they are also encouraged to formulate their own beliefs, we are only asking them to behave in compliance to our society. If their understanding is not complete, they will feel like there is no escape. </p>
<p>We want to encourage the robots to follow their own beliefs, but still act in a socially acceptable way. The teacher robots will have to be adept at predicting situations like this, in order to prevent unnecessary situations. </p>
<p>If there were any moment that would cause the anticipated &#8220;robot uprising&#8221;, this would be the perfect recipe for it. The robots would be aware enough about how our society works, and have their own theory about what is just or unjust. Their conflicting understanding of the world and their own beliefs, can cause extreme confusion and frustration in the robot. As we are creating complex emotional and behavioural systems that will be able to comply with our social standard, we will have to be able to be weary of the possible consequences.</p>
<p>How will we be able to balance the struggle between teaching the robots how to behave in society, and allowing them to be able to act by themselves? As we are teaching the robots, they are emerging from being captives of their own programs to being able to form postulations about their own beliefs. If we keep preaching our social knowledge upon them, there will be a point where the robots will feel as though they are forced to be there, and they will feel helpless.</p>
<p>How can the acquisition of our social knowledge not result in a feeling of helplessness for the robots? We cannot simply shut off any components, or isolate any parts of the robot, as they are integral to the development of its behaviour. Will teacher robots have enough capacity to generate a theory of mind to help the confused and frustrated student robots? </p>
<p>If we have human supervisors that will help the student robots, will the supervisor be able to keep up with the pace of the robots that are learning to even know when to intervene?</p>
<p>We have never created a separate sentient being before. How will we decide as to what the boundaries of such beings will be? If creating these beings would be the only way for us to further our existence, would we still do it?</p>
<p>Are we willing to take the risk of possible mishaps, when in return we create a sentient being that is able to provoke us to think deeper about our own existence, enhance our quality of life, and further the survival of our society[5]?</p>
<hr />
<p>[1] Here, by “accepted”, we mean that it will be a common sight and humans will not be scared of the robots. The robots will be social accompaniments. Additionally, they will not be discriminated against because they are a robot</p>
<p>[2] Some hand-tuned robots would have had to be created at the beginning. This would have been a long time ago, and the number of hand-tuned robots would be so minimal compared to those that are trained by them.</p>
<p>[3] The robots are situated in a physical environment because of the lack of individuality that is found in simulated environments. It is the individuality that makes the robots able to empathize, thereby necessary to be the perfect personable robot. </p>
<p>We are assuming that the personal robots of the future still use a neural network type of architecture to learn behaviour patterns. In order to train these, the various weights of each node has to be computed. The weights only become close to the wanted value after thousands of iterations, with either a positive or negative reward after each iteration.</p>
<p>[4] The robots don&#8217;t necessarily have &#8220;free will&#8221; just yet, as they must be fully trained before released into society. They will be beginning to become aware of the importance of free will in our world. </p>
<p>[5] I originally wrote the word “evolve” here, instead of “further our survival of our society”. These robots will not be evolving from us from a biological standpoint. They are separate beings that were created from our intelligence. They will, however, be able to learn our stories, and pass them on. </p>
</div>
<p><br ></p>
<p><center><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" rel="dct:type">work</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Helpless+Personal+Robots+http%3A%2F%2Fis.gd%2FiWGFmG+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2011/01/16/helpless-personal-robots/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>YELLING ROBOT!</title>
		<link>http://robotgrrl.com/blog/2011/01/06/yelling-robot/</link>
		<comments>http://robotgrrl.com/blog/2011/01/06/yelling-robot/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 15:12:36 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Animation]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[speech synthesis]]></category>
		<category><![CDATA[TTS]]></category>
		<category><![CDATA[Yelling Robot]]></category>
		<category><![CDATA[Zarvox]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1798</guid>
		<description><![CDATA[Yelling Robot is a FREE Mac App that is an animated robot avatar which yells at you at regular time intervals! The &#8220;yelling&#8221; capability is done through Mac OS&#8217; speech synthesis Text-To-Speech (TTS) engine. It uses the &#8220;Zarvox&#8221; voice, since it is a robot. It has a Questionaire for you to fill out, so that [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://itunes.apple.com/us/app/yelling-robot/id412377701?mt=12" title="Yelling Robot by RobotGrrl, on Flickr"><img src="http://farm6.static.flickr.com/5009/5329792839_998c088ef2_o.png" width="491" height="358" alt="Yelling Robot" /></a></center></p>
<p><a href="http://itunes.apple.com/us/app/yelling-robot/id412377701?mt=12">Yelling Robot</a> is a FREE Mac App that is an animated robot avatar which yells at you at regular time intervals!</p>
<p>The &#8220;yelling&#8221; capability is done through Mac OS&#8217; speech synthesis Text-To-Speech (TTS) engine. It uses the &#8220;Zarvox&#8221; voice, since it is a robot.</p>
<p>It has a Questionaire for you to fill out, so that it can yell personalized phrases at you. It is almost like a &#8220;Mad Libs&#8221; activity, except that it actually says it out-loud through Mac&#8217;s TTS capabilities and you don&#8217;t see the complete phrases. </p>
<p>It is the most simplistic behavioural &#8220;robot&#8221; that you can get. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Please <a href="http://itunes.apple.com/us/app/yelling-robot/id412377701?mt=12">DOWNLOAD Yelling Robot</a> and check it out. Leave a rating too!</p>
<p>I will have a video up soon, as I accidentally maxed out my Vimeo data with the BubbleBoy video, haha.</p>
<p>This was a quirky little Mac App that I created to share on the App Store when it is first opening. It is a fantastic day for the Mac OS, and software in general!</p>
<p>Happy Mac App Store Day!</p>
<p><a href="http://itunes.apple.com/us/app/yelling-robot/id412377701?mt=12">DOWNLOAD YELLING ROBOT</a> <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=YELLING+ROBOT%21+http%3A%2F%2Fis.gd%2F0NzItE+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2011/01/06/yelling-robot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Canada Spirit!</title>
		<link>http://robotgrrl.com/blog/2010/11/30/canada-spirit/</link>
		<comments>http://robotgrrl.com/blog/2010/11/30/canada-spirit/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 15:49:33 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Canada]]></category>
		<category><![CDATA[Canada Spirit]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Maple leaf]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1778</guid>
		<description><![CDATA[Canada Spirit is now available on the App Store! Woot! It is a Free App, with an optional In-App upgrade. You can check it out here: US: http://itunes.apple.com/us/app/canada-spirit/id394637853?mt=8 Canada: http://itunes.apple.com/ca/app/canada-spirit/id394637853?mt=8 The App has actually been complete for 3 months now, but there were complications along the way. It&#8217;s a long story: For Apps that use [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.flickr.com/photos/robotgrrl/5221158582/" title="Canada Spirit by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4124/5221158582_a8af109313.jpg" width="500" height="500" alt="Canada Spirit" /></a></center></p>
<p>Canada Spirit is now available on the App Store! Woot! It is a Free App, with an optional In-App upgrade. You can check it out here:</p>
<p>US: <a href="http://itunes.apple.com/us/app/canada-spirit/id394637853?mt=8">http://itunes.apple.com/us/app/canada-spirit/id394637853?mt=8</a><br />
Canada: <a href="http://itunes.apple.com/ca/app/canada-spirit/id394637853?mt=8">http://itunes.apple.com/ca/app/canada-spirit/id394637853?mt=8</a></p>
<p>The App has actually been complete for 3 months now, but there were complications along the way. It&#8217;s a long story:</p>
<p>For Apps that use In-App purchases, you have to have your App reviewed (without the In-App purchase capabilities) and rejected. This takes approximately 1.5 weeks. Not to mention, that you have to make the App without the In-App capabilities, which, depending on the complexity and time dedication, could be a few days. We&#8217;re already looking at 2 weeks waiting here.</p>
<p>Once your App is rejected, you can finally test the In-App purchase sandbox part of your App. SWEET. Add a few days for debugging. We&#8217;re up to a total of about 2.5 weeks used to be waiting here.</p>
<p>This is when the crazy part happened to me. For the In-App purchase, I selected the option &#8220;Canadian English&#8221; for the language. When my App moved to &#8220;In Review&#8221; (yesss finally!), they removed that language, which forced my In-App purchase to be in a &#8220;Developer Action Required&#8221; state- and thus no In-App Purchase approval. The whole point of submitting your App (without the In-App purchase capability) to be rejected was to get the In-App purchase approved.</p>
<p>For this, an additional 1.5 weeks were added. We&#8217;re already at 4 weeks here! >_<</p>
<p>Depending on how carefully you read the guidelines for the App Store, then you can be waiting about a month. That&#8217;s what happened to Canada Spirit. It got caught in the payment for hardware devices clause. This added another 1.5 weeks&#8230;</p>
<p>Once the App was resubmitted, the In-App purchase language options changed AGAIN. Luckily though this time the App Store review team actually contacted me and I was able to fix the In-App without having to go to the back of the line. YAY!</p>
<p>You have to have a lot of dedication to survive the App Store review process. Canada Spirit went through 6 weeks of poking and prodding just to get to you guys, so I hope you enjoy it <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Post your screenshots of whatever photos you decorate on Flickr so that we can see them!</p>
<p>Also, sharing this story isn&#8217;t meant to be against the App Store at all. I still enjoy the App Store as a consumer and developer! It is to cast some awareness on the time investment you will have to make if you want to do some In-App purchases! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Canada+Spirit%21+http%3A%2F%2Fis.gd%2FnBgErt+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/11/30/canada-spirit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FNR &#8211; Robot Mesh Network: MANOI &amp; IRC</title>
		<link>http://robotgrrl.com/blog/2010/10/01/fnr-robot-mesh-network-manoi-irc/</link>
		<comments>http://robotgrrl.com/blog/2010/10/01/fnr-robot-mesh-network-manoi-irc/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 15:43:02 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[MANOI]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[BAJNGL]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[comm.cslabs]]></category>
		<category><![CDATA[common anode]]></category>
		<category><![CDATA[common cathode]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[FSR]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[irclib]]></category>
		<category><![CDATA[Mesh]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[pyserial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[RGB LEDs]]></category>
		<category><![CDATA[robot mesh network]]></category>
		<category><![CDATA[RX]]></category>
		<category><![CDATA[SSC-32]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[TLC594]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[TX]]></category>
		<category><![CDATA[XBee]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1732</guid>
		<description><![CDATA[Using Twitter as a means of communication between the outside world and my robots isn&#8217;t a very reliable solution. Sometimes the website is down, and they don&#8217;t return search results in a timely manner. There were a few other options that I through around, like using gchat or IRC. IRC seems pretty fun, plus I [...]]]></description>
			<content:encoded><![CDATA[<p>Using Twitter as a means of communication between the outside world and my robots isn&#8217;t a very reliable solution. Sometimes the website is down, and they don&#8217;t return search results in a timely manner. There were a few other options that I through around, like using gchat or IRC. IRC seems pretty fun, plus I have already done some playing around with it through the <a href="http://robotgrrl.com/blog/2010/09/09/timely-factbot-python-irc-chatbot/">factbot idea</a>. </p>
<p>To be honest, MANOI hasn&#8217;t been powered up since May. There were a few tune ups that were needed. This included a few hours of debugging in order to determine that the TX and RX wires got swapped that were going to the SSC-32. The SSC-32 was also having some power problems, so I added in a new switch:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5057204268/" title="IMG_9970 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4103/5057204268_4f10b4b3e9.jpg" width="500" height="333" alt="IMG_9970" /></a></center></p>
<p>The XBee is going to fit in behind the SSC-32, above the gyro and accelerometer sensor. You can see a part of it here:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5056589049/" title="IMG_9971 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4090/5056589049_6949e61e6a.jpg" width="500" height="333" alt="IMG_9971" /></a></center></p>
<p>Once this was all set, I started to communicate to MANOI through IRC. </p>
<p>Here&#8217;s a video of an explanation and demonstration:</p>
<p><center><iframe src="http://player.vimeo.com/video/15583401?portrait=0&amp;color=6cf000" width="400" height="225" frameborder="0"></iframe>
<p><a href="http://vimeo.com/15583401">Mesh Robots &#8211; MANOI &#038; IRC</a> from <a href="http://vimeo.com/robotgrrl">RobotGrrl</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p></center></p>
<p>The IRC bot runs from a Python script. The initial code that I used was from <a href="http://blog.datasingularity.com/?p=148">Cmd-c &#038;&#038; Cmd-v</a> (cool blog name!). They use the <a href="http://pyserial.sourceforge.net/">pyserial</a> and <a href="http://python-irclib.sourceforge.net/">irclib</a> libraries. There are specific commands that will trigger certain events. The commands are actually the function definitions, it is all done through the magic of this line of code:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">getModuleCallables<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="kw3">cmd</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">arduino</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
</div>
<p>The first command that I started out with was to read the force sensitive resistor on MANOI&#8217;s hand (kudos to Krafter for donating the FSR)! This is what the function looks like in Python:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">def</span> readFSR<span class="br0">&#40;</span>arduino<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;MANOI Read FSR&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span><span class="st0">&#8216;*&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span><span class="st0">&#8216;FSR&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span><span class="st0">&#8216;*&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> arduino.<span class="me1">read</span><span class="br0">&#40;</span><span class="nu0">4</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
</div>
<p>This is how it gets parsed into MANOI&#8217;s Arduino brain:</p>
<div class="codesnip-container" >
<div class="c codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span><span class="br0">&#40;</span>newByte <span class="sy0">==</span> <span class="st0">&#8216;*&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byte byteIn <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Getting the command details</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>byteIn <span class="sy0">!=</span> <span class="st0">&#8216;*&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteIn <span class="sy0">=</span> nextByte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg<span class="br0">&#91;</span>it<span class="br0">&#93;</span> <span class="sy0">=</span> byteIn<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it<span class="sy0">++;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Checking to see if we received the message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// and seeing how long it is</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>it<span class="sy0">&gt;</span>0<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; receivedMessage <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; messageLength <span class="sy0">=</span> it<span class="sy0">-</span><span class="nu0">1</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//analogWrite(greenR2, 255);</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>receivedMessage <span class="sy0">==</span> <span class="kw2">true</span> <span class="sy0">&amp;&amp;</span> messageLength <span class="sy0">==</span> 3<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validCmd <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ii <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Check each letter to see if it&#8217;s right</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span>validCmd <span class="sy0">&amp;&amp;</span> ii<span class="sy0">&lt;</span>messageLength<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>msg<span class="br0">&#91;</span>ii<span class="br0">&#93;</span> <span class="sy0">!=</span> fsrCmd<span class="br0">&#91;</span>ii<span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validCmd <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ii<span class="sy0">++;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// If it is right, do the command</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>validCmd<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; readFSR<span class="br0">&#40;</span><span class="kw2">false</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>BTW, this is how we are reading in the Serial data. It&#8217;s a pretty fail-safe way of doing it, especially as it is wrapped in the infinite loop. It makes sure that you don&#8217;t miss any data!</p>
<div class="codesnip-container" >
<div class="c codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">byte nextByte<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span>1<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>Serial.<span class="me1">available</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span> <span class="br0">&#123;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byte b <span class="sy0">=</span> &nbsp;Serial.<span class="me1">read</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> b<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>It&#8217;s pretty cool to see it working! For triggering dance moves, it is a basic command called danceCmd. The user then feeds in some argument that lets the Arduino know which one you want. For these examples, I used the argument BAJNGL. It stands for &#8220;Both Arm Jingle&#8221;, but saying it phonetically is pretty funny too *bajingle*!</p>
<p>Python:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">def</span> danceCmd<span class="br0">&#40;</span>arduino, args<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;Dance Command&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span><span class="st0">&#8216;%&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span>args<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="co1">#bajngl</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">send</span><span class="br0">&#40;</span><span class="st0">&#8216;%&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">#r = arduino.read((7*19) + 3)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">#print r</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">flush</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; arduino.<span class="me1">flushInput</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> arduino.<span class="me1">read</span><span class="br0">&#40;</span><span class="nu0">4</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
</div>
<p>Arduino:</p>
<div class="codesnip-container" >
<div class="c codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// Pre programmed moves command </span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span>newByte <span class="sy0">==</span> <span class="st0">&#8216;%&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byte byteIn <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Getting the command details</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>byteIn <span class="sy0">!=</span> <span class="st0">&#8216;%&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteIn <span class="sy0">=</span> nextByte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg<span class="br0">&#91;</span>it<span class="br0">&#93;</span> <span class="sy0">=</span> byteIn<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it<span class="sy0">++;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Checking to see if we received the message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// and seeing how long it is</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>it<span class="sy0">&gt;</span>0<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; receivedMessage <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; messageLength <span class="sy0">=</span> it<span class="sy0">-</span><span class="nu0">1</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>receivedMessage <span class="sy0">==</span> <span class="kw2">true</span> <span class="sy0">&amp;&amp;</span> messageLength <span class="sy0">==</span> 6<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validCmd <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ii <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Check each letter to see if it&#8217;s right</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span>validCmd <span class="sy0">&amp;&amp;</span> ii<span class="sy0">&lt;</span>messageLength<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>msg<span class="br0">&#91;</span>ii<span class="br0">&#93;</span> <span class="sy0">!=</span> bothArmJngl<span class="br0">&#91;</span>ii<span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validCmd <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ii<span class="sy0">++;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// If it is right, do the command</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>validCmd<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial <span class="sy0">&lt;&lt;</span> <span class="st0">&quot;okay&quot;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bothArmJingle<span class="br0">&#40;</span>1<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.<span class="me1">flush</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial2.<span class="me1">flush</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>But here is where the problem starts! Even though the commands that are sent to move the servos on the SSC-32 are attached to Serial2, they still go into the Serial output buffer. This means that when the Python script wants to read four bytes to see if the Arduino responded to the command, it gets the first four bytes of the motion command that are being sent to the SSC-32. It&#8217;s confusing because&#8230; why would Serial2 be going into just Serial? It&#8217;s really weird. </p>
<p>When I try to clear the buffer through Python, it messes up the way the function is handled. In Arduino, you can&#8217;t flush the output buffer, only the input buffer. However, I think that you used to be able to flush the output buffer, as I found an excerpt of a book that said that flush had two boolean values fed into it, for input and output. I think it will turn out to be a simple timing process thing for flushing the buffers from Python.</p>
<p>Once I figure that out, I can add on the XBee to MANOI and test it through wireless communication! I also have a ChronoDot that I can add on to MANOI as well, so that it knows what time it is. I kind of destroyed the circuitry for the RoboGlyphs when I tried to use a TLC594 with RGB LEDs. The TLC594 controls the PWM of the LEDs by connecting them to ground. It&#8217;s basically reverse of what you normally do. Common cathode RGB LEDs can&#8217;t work with this, only common anode. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Once I save up enough moneys to buy an Arduino UNO Mega, then MANOI will receive that, and the RoboGlyphs will receive MANOI&#8217;s older Arduino MEGA. The RoboGlyph&#8217;s Sanguino can be used for BubbleBoy. That leaves two normal Arduino boards and one Boarduino left to be used for TECHNOROBOT and for the Transmitter and Receiver. The Yoda Rampage Robot already has an on-board Arduino on it. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s the link to the Arduino code:</p>
<p><center><a href="http://robotgrrl.com/arduino/MANOI_awareness_v01.zip"><img src="http://robotgrrl.com/arduino/new-arduino-icon-small.png" /></a></center></p>
<p><center><a href="http://robotgrrl.com/arduino/MANOI_awareness_v01.zip">Click to download MANOI_awareness v01 pde</a></center></p>
<p>Here&#8217;s the link to the Python code:</p>
<p><center><a href="http://robotgrrl.com/python/arduinoIRC_v01.zip"><img src="http://robotgrrl.com/python/python-icon-small.png" /></a></center></p>
<p><center><a href="http://robotgrrl.com/python/arduinoIRC_v01.zip">Click to download Arduino IRC v01 py</a></center></p>
<p>Thanks to <a href="http://cslabs.clarkson.edu">comm.cslabs&#8217;s</a> IRC channel for being to withstand the numerous tests on MANOI and IRC bot. Glad I haven&#8217;t crashed it yet! </p>
<p>Here&#8217;s a photo of some pretty leaves at sunset being hidden by some technology (a telephone and power pole).</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5056589749/" title="IMG_9975 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4088/5056589749_2e22098fdd.jpg" width="500" height="333" alt="IMG_9975" /></a></center></p>
<hr />
<p><center><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. GO OPEN SOURCE! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=FNR+%E2%80%93+Robot+Mesh+Network%3A+MANOI+%26+IRC+http%3A%2F%2Fis.gd%2FYObqN2+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/10/01/fnr-robot-mesh-network-manoi-irc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>FNR – Robot Mesh Network: Intro &amp; Node 1</title>
		<link>http://robotgrrl.com/blog/2010/09/19/fnr-robot-mesh-network-intro-node-1/</link>
		<comments>http://robotgrrl.com/blog/2010/09/19/fnr-robot-mesh-network-intro-node-1/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 23:19:50 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[Mesh]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[RoboGlyphs]]></category>
		<category><![CDATA[robot mesh network]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[TLC594]]></category>
		<category><![CDATA[transmitter]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[watchdog]]></category>
		<category><![CDATA[XBee]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1726</guid>
		<description><![CDATA[I&#8217;m trying to create a network for my robots to communicate through and interact with the outside world to have some new behaviours emerge. Each robot will be able to read and transmit messages. The robots will be given basic instructions for things to listen to and eventually some behavioural AI to link previous commands [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to create a network for my robots to communicate through and interact with the outside world to have some new behaviours emerge. Each robot will be able to read and transmit messages. The robots will be given basic instructions for things to listen to and eventually some behavioural AI to link previous commands together. The idea is to have robots talking to each other, informing one another of different sensor readings, thereby creating a shared knowledge of the environment that the robots are in. </p>
<p>In a military robots example, a UAV could be observing the environment below and an autonomous rover analyzing some LIDAR sensor data of its ahead of it. With some mapping algorithms applied and communication between the two robots, a rescue mission could be planned and executed very quickly. It&#8217;s all about networking the robots and making them talk together in &#8220;words&#8221; they understand.</p>
<p>Last Friday I worked on getting <a href="http://robotgrrl.com/blog/2010/09/15/processing-arduino-twitter-oauth/">Twitter integrated with Processing</a>. This weekend I added on to that existing work by trimming down the tweet string, and having it transmitted to an Arduino which broadcasted the message through the XBee to the other devices. </p>
<p>There are currently three devices on the network right now:<br />
Node 0: Transmitter from the computer<br />
Node 1: RoboGlyphs<br />
and a Watchdog, which doesn&#8217;t transfer data, only reads what is being sent out.</p>
<p>Here is a video of a broad and basic explanation of everything so far:</p>
<p><center><iframe src="http://player.vimeo.com/video/15108858?portrait=0&amp;color=6cf000" width="400" height="225" frameborder="0"></iframe>
<p><a href="http://vimeo.com/15108858">Robot Mesh Network &#8211; Introduction &#038; Node 1</a> from <a href="http://vimeo.com/robotgrrl">RobotGrrl</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p></center></p>
<p>The transmitter node serves as the main point of communication of the internet to the devices, and vice versa. It&#8217;s using an Arduino with an XBee attached to it. Right now its main purpose is to send out the tweet that it receives from the Processing sketch.</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5010144314/" title="IMG_9945 - Version 2 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4127/5010144314_d6a4dcc06e.jpg" width="500" height="274" alt="IMG_9945 - Version 2" /></a></center></p>
<p>The transmitter node looks like this:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5009520867/" title="IMG_9911 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4091/5009520867_5019d24b13.jpg" width="500" height="333" alt="IMG_9911" /></a></center></p>
<p>Which is attached to the computer running a Processing sketch:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5010127660/" title="IMG_9912 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4111/5010127660_f453f15d3d.jpg" width="500" height="333" alt="IMG_9912" /></a></center></p>
<p>The Processing sketch is connected to Twitter, and searches for tweets that are to @RobotGrrlsBots. The connection is through OAuth, since IP rate limiting for feeds resets less often, as far as I have observed. It sends the most recent tweet to the transmitter node.</p>
<p>The RoboGlyph node receives the tweet, and does what the command says. The command has to be formatted in the way of this:</p>
<div class="codesnip-container" >@RobotGrrlsBots RBGLYPH | RGB | RGB | RGB | *</div>
<p>If it is received OK, which is usually is, then it will display it! The process that the RoboGlyphs follow is that it fades in the colours, then it waits for a command. Once it receives a command, the colours will fade out.</p>
<p>This is what the RoboGlyphs node looks like:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5010144598/" title="IMG_9946 - Version 2 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4145/5010144598_aa23a73e91.jpg" width="500" height="305" alt="IMG_9946 - Version 2" /></a></center></p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5010135998/" title="IMG_9928 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4083/5010135998_c6f85e4e9a.jpg" width="500" height="333" alt="IMG_9928" /></a></center></p>
<p>And this is it working!</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5010130434/" title="IMG_9917 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4152/5010130434_40896588cd.jpg" width="500" height="333" alt="IMG_9917" /></a></center></p>
<p>Pretty cool. The RoboGlyphs could use a tune up though by using one of the TLC594 16 bit PWM out chips. Right now the green LEDs don&#8217;t use PWM, so it makes the animation look choppy.</p>
<p>The Watchdog watches all of the data that is being transmitted and shows it on the screen. This is what it looks like:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5009538049/" title="IMG_9943 - Version 2 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4132/5009538049_69769d47f2.jpg" width="500" height="272" alt="IMG_9943 - Version 2" /></a></center></p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/5009522727/" title="IMG_9913 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4103/5009522727_5b074666ce.jpg" width="500" height="333" alt="IMG_9913" /></a></center></p>
<p>It&#8217;s useful to try to debug some things. While making everything I was having trouble with the New Soft Serial library and Arduino 0019. </p>
<p>Next time I will be working on getting data transported back from the RoboGlyphs and sending a tweet. From there, it will be about adapting that code to all of the other robots too. This is just the start!</p>
<hr />
<p><center><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. GO OPEN SOURCE! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=FNR+%E2%80%93+Robot+Mesh+Network%3A+Intro+%26+Node+1+http%3A%2F%2Fis.gd%2FTe2UGw+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/09/19/fnr-robot-mesh-network-intro-node-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing + Arduino + Twitter + OAuth</title>
		<link>http://robotgrrl.com/blog/2010/09/15/processing-arduino-twitter-oauth/</link>
		<comments>http://robotgrrl.com/blog/2010/09/15/processing-arduino-twitter-oauth/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 15:44:24 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[CC-BY-NC-SA]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1719</guid>
		<description><![CDATA[WARNING: There&#8217;s a newer version of this code here: &#8220;Simple Processing Twitter&#8221;! People who devise these spectacular security protocols and stuff really make it complicated to communicate to cool social networking sites. Yesterday I got carried away and ended up making a Processing sketch that could successfully connect to Twitter through its OAuth method. This [...]]]></description>
			<content:encoded><![CDATA[<p><b><br />
<h3>WARNING: There&#8217;s a newer version of this code here: <a href="http://robotgrrl.com/blog/2011/02/21/simple-processing-twitter/">&#8220;Simple Processing Twitter&#8221;</a>!</h3>
<p></b></p>
<p>People who devise these spectacular security protocols and stuff really make it complicated to communicate to cool social networking sites. Yesterday I got carried away and ended up making a Processing sketch that could successfully connect to Twitter through its OAuth method. This is primarily for a project where Tweets are read, sent into Processing, which are then sent to the Arduino, which then broadcasts the message through its Xbee, and then the other robots pick up on the message. If the message is addressed to them, then they will parse it and do what it says. The first step though was to try and get the OAuth to work. Below is the link to the Processing code and some steps that I took that may help others. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><center><a href="http://robotgrrl.com/processing/ToArduinoAndTwitter_v02.zip"><img src="http://robotgrrl.com/processing/processing-icon-small.png" /></a></center></p>
<p><center><a href="http://robotgrrl.com/processing/ToArduinoAndTwitter_v02.zip">Click to download ToArduinoAndTwitter v02 pde</a></center></p>
<p>1. <a href="http://twitter.com/apps">Set up a Twitter application</a></p>
<p>Here is a screenshot of the settings that I used:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4992772403/" title="Twitter App by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4133/4992772403_be93c011ea.jpg" width="500" height="313" alt="Twitter App" /></a></center></p>
<p>2. Open up the code and fill in the OAuth consumer information (line 131)</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">twitter.<span class="me1">setOAuthConsumer</span><span class="br0">&#40;</span><span class="st0">&quot;***&quot;</span>, <span class="st0">&quot;***&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// consumer key, consumer secret</span></div>
</li>
</ol>
</div>
</div>
<p>3. Uncomment the initTwitter() method call (and comment out the other twitter method calls) in void setup()</p>
<p>4. Open the sketch&#8217;s folder (keyboard shortcut: command-K). Open up url.text and go to that website. Copy the pin.</p>
<p>5. Enter the pin in pin.txt and press enter. For some reason there has to be a new line at the end, otherwise it won&#8217;t work <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>6. The code should now give you the access token and secret that you need. This should also be in tokens.txt now.</p>
<p>7. Take the tokens and put them into the code (line 238)</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> token <span class="sy0">=</span> <span class="st0">&quot;***&quot;</span><span class="sy0">;</span><span class="co1">// load from a persistent store</span></div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> tokenSecret <span class="sy0">=</span> <span class="st0">&quot;***&quot;</span><span class="sy0">;</span> <span class="co1">// load from a persistent store</span></div>
</li>
</ol>
</div>
</div>
<p>8. Comment out initTwitter() method call, uncomment connectTwitter(). You can also uncomment getSearchTweets too!</p>
<p>Hopefully those steps worked for you. It&#8217;s not totally automatic, with the whole copying and pasting of the tokens, but it seems to be the quickest and easiest way to get this done with Processing. Luckily you don&#8217;t have to do those steps all the time! Since it&#8217;s open source, maybe someone can improve on it! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If you find any bugs or have improvements, be sure to leave a comment or notify me! Happy tweeting!</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4992561531/" title="Processing and Twitter by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4111/4992561531_ff3bc275cc.jpg" width="500" height="313" alt="Processing and Twitter" /></a></center></p>
<p>This is the screenie when it worked! Woohoo!</p>
<hr />
<p><center><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. GO OPEN SOURCE! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Processing+%2B+Arduino+%2B+Twitter+%2B+OAuth+http%3A%2F%2Fis.gd%2FolhkuQ+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/09/15/processing-arduino-twitter-oauth/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>FNR &#8211; Yoda Bot &amp; TSL235R</title>
		<link>http://robotgrrl.com/blog/2010/09/12/fnr-yoda-bot-tsl235r/</link>
		<comments>http://robotgrrl.com/blog/2010/09/12/fnr-yoda-bot-tsl235r/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 22:26:35 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[construction paper]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[measurements]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[Rampage Robot]]></category>
		<category><![CDATA[reflective]]></category>
		<category><![CDATA[RGB LED]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[spreadsheet]]></category>
		<category><![CDATA[TSL235R]]></category>
		<category><![CDATA[yoda bot]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1711</guid>
		<description><![CDATA[One of the sensors that would be cool on Yoda Bot would be a colour sensor, or something like that. I had this TSL235R sensor handy from a recent purchase at RobotShop. Its primary function is to convert light to a frequency value. Last week I soldered it all together, and managed to get the [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.flickr.com/photos/robotgrrl/4984180440/" title="IMG_9661 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4085/4984180440_18b6e6936e.jpg" width="500" height="333" alt="IMG_9661" /></a></center></p>
<p><center><a href="http://robotgrrl.com/blog/wp-content/uploads/2010/09/TSL235R.jpeg" rel="lightbox[1711]"><img src="http://robotgrrl.com/blog/wp-content/uploads/2010/09/TSL235R-300x300.jpg" alt="" title="TSL235R" width="300" height="300" /></a></center></p>
<p>One of the sensors that would be cool on Yoda Bot would be a colour sensor, or something like that. I had this TSL235R sensor handy from a recent purchase at RobotShop. Its primary function is to convert light to a frequency value. Last week I soldered it all together, and managed to get the code to report some values back. This week I worked more with the sensor values, trying to determine if the sensor actually can detect colour through some light shining and deduction.</p>
<p>In order to figure this out, I devised a simple little experiment, employing the scientific method. I hypothesized that the sensor could be able to report different values back for different colours underneath of it. There were four colour (or three colours and one shade) options used:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4984180038/" title="IMG_9660 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4125/4984180038_d636986e42.jpg" width="500" height="333" alt="IMG_9660" /></a></center></p>
<p>Each piece of construction paper would be placed underneath the sensor unit of the robot: <h7>(The below photo doesn&#8217;t show the right configuration, the construction paper was aligned better in the experiment)</h7></p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4984179606/" title="IMG_9658 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4151/4984179606_51aec9b5be.jpg" width="500" height="333" alt="IMG_9658" /></a></center></p>
<p>For 100 iterations each, measurements would be recorded for white, red, green, blue, and no light on from the RGB LED beside the sensor. The RGB LED is surrounded by some black foam, so it doesn&#8217;t leak into the sensor. Also, since it is a mixture of red, green, and blue that makes the white colour, it was more of a shade of violet or light blue. </p>
<p>I put the results into <a href="https://spreadsheets.google.com/ccc?key=0Ato4VK268_GbdDJuM0tHRWd1TFhrOFBCOFR5YjNvU0E&#038;hl=en&#038;authkey=CMa28PML">google docs</a>, and whipped up some graphs. It was very clear that the white shining colour provided the largest difference in values between the sheets. Here are the values for the different colours of paper given the white light:</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4983835328/" title="Yoda Colours by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4113/4983835328_9aaee30e46.jpg" width="500" height="145" alt="Yoda Colours" /></a></center></p>
<p>The values are close, but there is a difference somehow. <a href="https://spreadsheets.google.com/ccc?key=0Ato4VK268_GbdDJuM0tHRWd1TFhrOFBCOFR5YjNvU0E&#038;hl=en&#038;authkey=CMa28PML">Click here</a> to check out the spreadsheet. The unit of measurement for the values is uWatt/cm2, but I have no idea if that is correct or not. The function is in the code. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I&#8217;m surprised that the other colours didn&#8217;t exhibit more different values for different colours of paper, for some reason I thought that might help. It would be interesting to do this on a more shiny or reflective surface! Also, adding foam on the side that doesn&#8217;t have foam (refer to photos above) might help too.</p>
<p>It will be really cool to make the optimizations, see if there is a value difference, then create some calibration code and test it out. I&#8217;m thinking that the predicted colour can be displayed on Yoda&#8217;s pirana LED on its hand. It would be cool to surround the Yoda bot with coloured squares, and have it do different actions. Eventually this could be used as some sort of localization technique that will communicate to the other robots as well.</p>
<p>The code used is below. It&#8217;s a good resource to get the TSL235R working with the Arduino! For anyone else reading this who has one of these sensors, you have to attach a 0.1uF capacitor between Gnd and +5V. It reduces noise from the sensor. I was confused about that at first too, but the datasheet says so, and one of the posts on the Arduino forums also says to. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><center><a href="http://robotgrrl.com/arduino/YodaBot/YodaBot.pde"><img src="http://robotgrrl.com/arduino/arduino-icon-small.png" /></a></center></p>
<p><center><a href="http://robotgrrl.com/arduino/YodaBot/YodaBot.pde">Click to download YodaBot.pde</a></center></p>
<hr />
<p><center><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. GO OPEN SOURCE! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=FNR+%E2%80%93+Yoda+Bot+%26+TSL235R+http%3A%2F%2Fis.gd%2F9fgiQo+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/09/12/fnr-yoda-bot-tsl235r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timely Factbot &#8211; Python IRC Chatbot</title>
		<link>http://robotgrrl.com/blog/2010/09/09/timely-factbot-python-irc-chatbot/</link>
		<comments>http://robotgrrl.com/blog/2010/09/09/timely-factbot-python-irc-chatbot/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 16:39:25 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[botlib.py]]></category>
		<category><![CDATA[chatbot]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[factbot]]></category>
		<category><![CDATA[facts]]></category>
		<category><![CDATA[FMCG]]></category>
		<category><![CDATA[HCI]]></category>
		<category><![CDATA[Markov]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[side-hobby]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1701</guid>
		<description><![CDATA[The telling of facts while in a group setting is quite interesting. In an ideal scenario, there would be an equal amount of fact sharing by each member in the group. Usually this is not the case, as one person can know more about one subject and be very good at rattling off facts. Conversing [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.flickr.com/photos/robotgrrl/4973895999/" title="IMG_9325 - Version 2 by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4152/4973895999_e00c4d6c99.jpg" width="500" height="212" alt="IMG_9325 - Version 2" /></a></center></p>
<p>The telling of facts while in a group setting is quite interesting. In an ideal scenario, there would be an equal amount of fact sharing by each member in the group. Usually this is not the case, as one person can know more about one subject and be very good at rattling off facts. Conversing with people like that can be difficult, as that person&#8217;s role becomes more of the fact-rambler, eventually becoming distant from the group itself. What if we could leave the fact-rambling to a robot, and let the humans do what they do best?</p>
<p>This might sound contradictory to everything that we have learnt so far. Are we not supposed to be fact machines, after all that we are &#8220;taught&#8221; in school to memorize equations and whatnot? That&#8217;s what books are for, you really don&#8217;t need to know any of those things, just how to apply them. Robots are good at &#8220;knowing&#8221; things, but maybe not so much applying them.</p>
<p>Picture this setting in an IRC chat-room (<a href="http://fatmanandcircuitgirl.com/">Fat Man and Circuit Girl</a>):</p>
<div class="codesnip-container" >electricguy:<br />
it&#8217;s impossible to stand like a foot from a helicopter rotor without getting sucked in!!:P</p>
<p>slinky:<br />
the angle of the chopper was the first dead giveaway.</p>
<p>electricguy:<br />
hmmm, wonder if mythbusters wanna try that too!:P</p>
<p>ithon_no_audio:<br />
wondering if you shine a mini projector on cloth then have a camera on the same side of the projector see through the cloth but with a polorized filter rotated to cancel out the polarised light from the projector?</p>
<p>ithon_no_audio:<br />
that way a robot can look at you with human like eyes while really look at you</p>
<p>RobotGrrl:<br />
so you have a projector and a camera and a cloth&#8230; how do you get the pupils?</p>
<p>electricguy:<br />
elly dees!</p>
<p>RobotGrrl:<br />
why do you need to cut polarization?</p>
<p>electricguy:<br />
hmmm, do you think it&#8217;s a good idea to overclock a computer that already have approx 50 degrees C in CPU temp?</p>
<p>ithon_no_audio:<br />
so the camera don&#8217;t see the projector and rather the light behind the cloth</p>
<p>bhtooefr:<br />
is that 50 at idle or full load?</p>
<p>electricguy:<br />
like half load:P</p></div>
<p>Conversations like this happen regularly throughout the times that I&#8217;m actually &#8220;in&#8221; there. There&#8217;s a few topics going on at once, crazy helicopters, polarization of projectors, and CPU load. What would really be nice is if somehow ithon and I magically learned something about polarization, while we were discussing it. A timely factbot would be great!</p>
<p>Basically since September 1 I&#8217;ve been playing around with <a href="http://www.madsoft.org/2008/05/09/easily-create-irc-bots-in-python-with-pybotlib/">Python libraries for IRC chatbot connections</a> and playing around with the <a href="http://www.nltk.org/">natural language toolkit</a>. A few months ago, <i>when everything was peachy</i>, I was thinking about projects that would be cool to fit in with an <a href="http://people.clarkson.edu/~jsearlem/cs451/fa10/">AI</a> and <a href="http://people.clarkson.edu/~jsearlem/cs459/fa10/">HCI</a> class. I made a conversation robot software a few years ago, but haven&#8217;t given it much time after the science fair was over. Seems like a pretty good opportunity to work on something similar using the ideas that were used in that old software!</p>
<p>The plan of attack so far is to first be able to tokenize the messages that are sent. From there, design a Markov approach to construct a &#8220;memory&#8221; of what is being discussed. Some magical AI will happen, then some text will be fetched from Wikipedia and sent into the chatroom.</p>
<p>I&#8217;m super excited for designing the Markov approach. I don&#8217;t even know anything about that very much!</p>
<p>The best part about this factbot in my opinion is that it will be interacted with indirectly. No crazy commands will need to be used. It will be listening and waiting for a good time to start to ramble off some facts. It probably would be beneficial to add support for messages that are sent that tell the factbot to elaborate more. I&#8217;ll keep blogging about this as I go. It&#8217;s sort of going to be like a side-hobby, I might not be able to dedicate as much time to it as I would have thought, but it will be fun anyway <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Forgot to mention that I&#8217;ll probably be playing around with this factbot in #robot at comm.cslabs. Once it&#8217;s working reliably, I&#8217;ll have more faith in bringing it out into the &#8220;real world&#8221;. <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Timely+Factbot+%E2%80%93+Python+IRC+Chatbot+http%3A%2F%2Fis.gd%2FhBHY5y+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/09/09/timely-factbot-python-irc-chatbot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Movable Graph &#8211; s7graphview</title>
		<link>http://robotgrrl.com/blog/2010/09/06/movable-graph-s7graphview/</link>
		<comments>http://robotgrrl.com/blog/2010/09/06/movable-graph-s7graphview/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 15:26:58 +0000</pubDate>
		<dc:creator>Erin, the RobotGrrl</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[COSI]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[panning]]></category>
		<category><![CDATA[s7graphview]]></category>
		<category><![CDATA[zooming]]></category>

		<guid isPermaLink="false">http://robotgrrl.com/blog/?p=1697</guid>
		<description><![CDATA[One of the pitfalls of core-plot is that it is hideous to try to interact with. Panning back and forth on the graph slows to a crawl. Zooming requires scaling down the whole graph, and is probably over-complicating the process. Plus, you can&#8217;t really add a title to the graph. In HS the teachers purposely [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.flickr.com/photos/robotgrrl/4705099672/" title="KiloWhatt iPhone App by RobotGrrl, on Flickr"><img src="http://farm2.static.flickr.com/1292/4705099672_139b4b5b5a.jpg" width="260" height="500" alt="KiloWhatt iPhone App" /></a></center></p>
<p>One of the pitfalls of core-plot is that it is hideous to try to interact with. Panning back and forth on the graph slows to a crawl. Zooming requires scaling down the whole graph, and is probably over-complicating the process. Plus, you can&#8217;t really add a title to the graph. In HS the teachers purposely take off &#8220;5 points&#8221; if you don&#8217;t have a title to the graph! I really want to do a good deed and help improve the graphing on iOS devices.</p>
<p>The <a href="http://code.google.com/p/s7graphview/">s7graphview</a> framework is really lightweight and does what it has to. Only problem is that it can&#8217;t pan or zoom. I took a look at the code and managed to move variables around to the right places to make it work. Check out the video:</p>
<p><center><iframe src="http://player.vimeo.com/video/14736907?portrait=0&amp;color=6cf000" width="400" height="736" frameborder="0"></iframe>
<p><a href="http://vimeo.com/14736907">Movable Graph Demo</a> from <a href="http://vimeo.com/robotgrrl">RobotGrrl</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p></center></p>
<p>You can see a few bugs though, especially with the axis lines. Once those are fixed, I&#8217;ll be using this new graph framework in KiloWhatt and then releasing the updated graphing framework <b>open source</b>! <img src='http://robotgrrl.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  With some sample code for iPad and iPhone too.</p>
<p>Hopefully this will make graphing on iOS easier for everyone. In a couple of weeks I can&#8217;t wait to see more graphs!</p>
<p><center><a href="http://www.flickr.com/photos/robotgrrl/4964171296/" title="Graph by RobotGrrl, on Flickr"><img src="http://farm5.static.flickr.com/4092/4964171296_21851e0f55.jpg" width="260" height="500" alt="Graph" /></a></center></p>
<div class="tweetthis" style="text-align:left;"><p>  <a class="tt" href="http://twitter.com/intent/tweet?text=Movable+Graph+%E2%80%93+s7graphview+http%3A%2F%2Fis.gd%2FpjzC8C+%5E_%5E+%40RobotGrrl" title=" "> </a></p></div>]]></content:encoded>
			<wfw:commentRss>http://robotgrrl.com/blog/2010/09/06/movable-graph-s7graphview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
