<?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=15&amp;t=9031" />

<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>2013-01-10T20:54:39+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=15&amp;t=9031</id>
<entry>
<author><name><![CDATA[nicolas gomez]]></name></author>
<updated>2013-01-10T20:54:39+01:00</updated>
<published>2013-01-10T20:54:39+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9031&amp;p=36962#p36962</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9031&amp;p=36962#p36962"/>
<title type="html"><![CDATA[Arduino uno + SAM3]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9031&amp;p=36962#p36962"><![CDATA[
Hi<br />here a sam3 servo with arduino UNO<br /><br /><div class='bbmedia' data-url='http://www.youtube.com/watch?v=DywHQXUJcmU' style='margin: 1px; display: inline-block; vertical-align: bottom;'><div style='width: 200px; height: 40px; border: 1px solid #999; display: table-cell; text-align: center; vertical-align: middle; font: 10px/10px Verdana; color: #555; opacity: 0.5;'><a style='color: #105289; text-decoration: none;' href='http://phpbbex.com/' target='_blank'>phpBB</a> &#91;media&#93;</div><script>if (typeof bbmedia == 'undefined') { bbmedia = true; var e = document.createElement('script'); e.async = true; e.src = 'js/bbmedia.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); }</script></div><br /><br /><br />At 1-second intervals SAM3 back and forth between the position values ​​of 20 and 120.<br />Realistically UNO board power simply turning the servo one I use works fine.<br />Lines connect the UNO R3 connection has been so from the board.<br />VCC of 5V ~ SAM3<br />TX (DIGITAL 1 time) ~ SAM3 of RX<br />RX (DIGITAL 2 times) SAM3 of TX<br />GND GND ~ SAM3<br /><br /><br /><br />/*<br />  Blink &amp; SAM Control<br />  Turns on an LED and changes a SAM position on for one second, then off for one second, repeatedly.<br /> <br />  This example code is in the public domain.<br /> */<br /> <br />// Pin 13 has an LED connected on most Arduino boards.<br />// give it a name:<br />int led = 13;<br />// for SAM control<br />int id;        // SAM id<br />int torq;      // torque level(0:max, 4:min)<br />int checksum;  // protocol checksum<br />int tmp1, tmp2;      // temporary byte<br />// the setup routine runs once when you press reset:<br />void setup() {                <br />  // initialize the digital pin as an output.<br />  pinMode(led, OUTPUT);<br />  // start serial port at 115200 bps:<br />  Serial.begin(115200);<br />  while (!Serial) {<br />    ; // wait for serial port to connect. Needed for Leonardo only<br />  }<br />  id = 0;<br />  torq = 2;<br />}<br />// the loop routine runs over and over again forever:<br />void loop() {<br />  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)<br />  tmp1 = (torq &lt;&lt; 5) | id;<br />  tmp2 = 20;                  // position1<br />  checksum = (tmp1 ^ tmp2) &amp; 0x7f;<br />  Serial.write(0xff);<br />  Serial.write(tmp1);<br />  Serial.write(tmp2);<br />  Serial.write(checksum);<br />  delay(1000);               // wait for a second<br />  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW<br />  tmp1 = (torq &lt;&lt; 5) | id;<br />  tmp2 = 120;                  // position2<br />  checksum = (tmp1 ^ tmp2) &amp; 0x7f;<br />  Serial.write(0xff);<br />  Serial.write(tmp1);<br />  Serial.write(tmp2);<br />  Serial.write(checksum);<br />  delay(1000);               // wait for a second<br />}<br />--------------------------------------------------------------<br /><br />SOURCE FROM<br /><!-- m --><a class="postlink" href="http://blog.daum.net/r0b0t/12725810">http://blog.daum.net/r0b0t/12725810</a><!-- m --><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1610">nicolas gomez</a> — Thu Jan 10, 2013 8:54 pm</p><hr />
]]></content>
</entry>
</feed>