<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=4&amp;t=6458" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2010-07-29T15:46:07+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=4&amp;t=6458</id>
<entry>
<author><name><![CDATA[robonova]]></name></author>
<updated>2010-07-29T15:46:07+01:00</updated>
<published>2010-07-29T15:46:07+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6458&amp;p=27685#p27685</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6458&amp;p=27685#p27685"/>
<title type="html"><![CDATA[Tilt sensor problem]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6458&amp;p=27685#p27685"><![CDATA[
I just got a tilt sensor for my RN-1. I used the example code that came with the instructions which also was the same code in the RN templates. The problem is that the sensor doesn't seem to be working correctly...or is too sensitive. It gets stuck in a loop to where the robot keeps doing the forward stand up move. If I lay the sensor on the the side it stops but if I barely move the sensor it starts again. <br /><br />Below is the code that came with the template and also as the example. It seems to be working for others. I've tried it with several different ports, so it's not just one port thats the cause.<br /><br />'robot_tilt: <br />robot_tilt: <br />A = AD(2) <br />IF A &gt; 250 THEN RETURN <br />IF A &lt;30&gt; 200 THEN GOTO tilt_high <br /><br />RETURN <br />tilt_low: <br />A = AD(2) <br />'IF A &lt; 30 THEN GOTO forward_standup <br />IF A &lt; 30 THEN GOTO backward_standup <br />RETURN <br />tilt_high: <br />A = AD(2) <br />'IF A &gt; 200 THEN GOTO backward_standup <br />IF A &gt; 200 THEN GOTO forward_standup <br /><br /><br /><br /><br />For me, I had to change the code that says<br /><br />IF A &gt; 200 THEN GOTO tilt_high <br /><br />to<br /><br />IF A &gt; 18 THEN GOTO tilt_high<br /><br />That change seemed to work as odd as it looks.....however....<br /><br />when I try to change this code<br /><br />IF A &lt; 30 THEN GOTO tilt_low <br /><br />to anything above 6 it keeps getting stuck in the loop and executing the move. If I change it to 6  .. in other words to:<br /><br />IF A &lt; 6 THEN GOTO tilt_low <br /><br />Then it won't every execute the move no matter how I turn the robot.<br /><br />Does anyone have any suggestion as to what I'm doing wrong or is it the sensor that is not working?<br /><br />Thanks<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2266">robonova</a> — Thu Jul 29, 2010 3:46 pm</p><hr />
]]></content>
</entry>
</feed>