<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6475726489711554308</id><updated>2026-07-01T07:13:13.218-07:00</updated><title type='text'>auzieman</title><subtitle type='html'>Robotics, Embedded Linux, Arduino, Python, C++ and more</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-6437170231668208668</id><published>2012-05-24T20:33:00.001-07:00</published><updated>2012-05-25T15:14:01.794-07:00</updated><title type='text'>Modeling a weighted random walk in c, porting to arduino..</title><content type='html'>Here is an experiment I was attempting when working on the linksprite arduino robot kit.&amp;nbsp; My idea is to make a weighted random walk and while the c++ code worked fairly well (some issues) the robot often got caught in a loop.&lt;br /&gt;
&lt;br /&gt;
To try out this code you should only need a c compiler, I used gcc under linux but honestly this is so simple you shouldn&#39;t need too complicated a setup.&amp;nbsp; Cygwin under windows or just about any c compiler should do the trick with a little work. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
pre.CICodeFormatter{
 font-family:arial;
 font-size:12px;
 border:1px dashed #CCCCCC;
 width:99%;
 height:auto;
 overflow:auto;
 background:#f0f0f0;
 line-height:20px;
 background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUx1oIzmoHADHvS8kZO5iUFpmffzxANk65IPu_zHuOYSQ0tsNR75nd6o8xT2yVDarvfYB_3Q4GoQMblzI6Z6mwdygtQaJWXPnrCpSu2Rwy8ilsrmOOq4MZdjPDGVkRWEyojlgZbyYd30hv/s320/codebg.gif);
 padding:0px;
 color:#000000;
 text-align:left;
}
pre.CICodeFormatter code{
 color:#000000;
 word-wrap:normal;
}
&lt;/style&gt;
&lt;pre class=&quot;CICodeFormatter&quot; &gt;&lt;code class=&quot;CICodeFormatter&quot;&gt;1:   #define _GNU_SOURCE   
2:   #include &amp;lt;stdio.h&amp;gt;   
3:   #include &amp;lt;math.h&amp;gt;   
4:   #include &amp;lt;stdlib.h&amp;gt;   
5:   #include &amp;lt;time.h&amp;gt;   
6:   int x=0;   
7:   int y=0;   
8:   int bias1=50;   
9:   int bias2=30;   
10:   int bias3=25;   
11:   int bias4=30;   
12:   int bias5=55;   
13:   int cnt;   
14:   int xmax=20;   
15:   int ymax=20;   
16:   int xp;   
17:   int yp;   
18:   int dc=0;   
19:   int out;   
20:   int area[20][20];   
21:   int rndm;   
22:   void intloc(){   
23:   xp=ymax/2;   
24:   yp=ymax/2;   
25:   printf(&quot;x %u, y %u \n&quot;,xp,yp);   
26:   }   
27:   initmap(){   
28:   for ( x=0 ; x &amp;lt; xmax ; x++ ){   
29:   for ( y=0 ; y &amp;lt; ymax ; y++ ){   
30:    area[x][y]=0;   
31:   }   
32:   }   
33:   }   
34:   void printmap(){   
35:   printf(&quot;Col \n&quot;);    
36:   for ( y=0 ; y &amp;lt; ymax ; y++ ){   
37:   printf(&quot;%u ;&quot;,y);   
38:   }   
39:   printf(&quot;\n&quot;);   
40:   for ( x=0 ; x &amp;lt; xmax ; x++ ){   
41:    printf(&quot;r %u; &quot;,x);   
42:   for ( y=0 ; y &amp;lt; ymax ; y++ ){   
43:   out=area[x][y];   
44:    printf(&quot;%u ;&quot;,out);   
45:   }   
46:   printf(&quot;\n&quot;);   
47:   }   
48:   }   
49:   void updloc(dc){   
50:   if (dc==0){   
51:   }   
52:   }   
53:   void main()   
54:   {   
55:   //randNumber = random(0, 150);   
56:   srand ( time(NULL) );   
57:   rndm=rand() % 150 + 1;   
58:   initmap();   
59:   intloc();   
60:   printmap();   
61:   for (cnt=0; cnt&amp;lt;100;cnt++){   
62:   rndm=rand() % 150 + 1;   
63:   printf(&quot;x %u, y %u rand:%u\n&quot;,xp,yp,rndm);   
64:   if ((rndm-bias1) &amp;lt;= 10 &amp;amp;&amp;amp; (rndm-bias1) &amp;gt; 0){   
65:   printf(&quot;east\n&quot;);   
66:   xp--;   
67:   }else if ((rndm-bias2) &amp;lt;= 40 &amp;amp;&amp;amp; (rndm-bias1) &amp;gt; 10){   
68:   printf(&quot;west\n&quot;);   
69:   xp++;   
70:   }else if ((rndm-bias3) &amp;lt;= 60 &amp;amp;&amp;amp; (rndm-bias1) &amp;gt; 40){   
71:   printf(&quot;north\n&quot;);  
72:   yp--;   
73:   }else if ((rndm-bias4) &amp;lt;= 70 &amp;amp;&amp;amp; (rndm-bias1) &amp;gt; 60){   
74:   printf(&quot;south\n&quot;);  
75:   yp++;   
76:   }else if ((rndm-bias5) &amp;lt;= 80 &amp;amp;&amp;amp; (rndm-bias1) &amp;gt; 70){   
77:   printf(&quot;north 2\n&quot;);   
78:   yp--;  
79:   printf(&quot;x %u, y %u rand:%u\n&quot;,xp,yp,rndm);   
80:   area[xp][yp]=5;  
81:   yp--;   
82:   }else {   
83:   printf(&quot;other\n&quot;);   
84:   }  
85:   //update position   
86:   printf(&quot;x %u, y %u rand:%u\n&quot;,xp,yp,rndm);   
87:   area[xp][yp]=5;   
88:   printmap();   
89:   //printf(&quot;Read line of %u characters: %s\n&quot;, read, line);    
90:   //printf(&quot;Read line of %u characters: %s\n&quot;, read, line);    
91:   }   
92:   }   
&lt;/code&gt;&lt;/pre&gt;
To be honest I would love to get this working better, I would love to find a book that actually covers this stuff better.  Not just a bunch of formulas but an actual from formula to source code examples.</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/6437170231668208668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/6437170231668208668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6437170231668208668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6437170231668208668'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2012/05/modeling-weighted-random-walk-in-c.html' title='Modeling a weighted random walk in c, porting to arduino..'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-6306153538238409476</id><published>2012-05-10T06:43:00.000-07:00</published><updated>2012-05-10T06:43:31.790-07:00</updated><title type='text'>A turn of the wheel,</title><content type='html'>More to follow but first,&lt;br /&gt;
&amp;nbsp;And he created the wheel and it was good!&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDqBaCz_xiPm7Hho5B3DtYDXyO319N3ZBJuTtjMlCyD5MsHNPSjPit8Zi_oZN9EzZZnFSA-NlAuM-iBa-UCvPzPS3ZKir2Ztz0wAE7mX54Nnmuxbnzzo8xSX5zWCadEU8njQnD7mWu_-Q/s1600/2012-05-07-072750.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDqBaCz_xiPm7Hho5B3DtYDXyO319N3ZBJuTtjMlCyD5MsHNPSjPit8Zi_oZN9EzZZnFSA-NlAuM-iBa-UCvPzPS3ZKir2Ztz0wAE7mX54Nnmuxbnzzo8xSX5zWCadEU8njQnD7mWu_-Q/s320/2012-05-07-072750.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Not too much to add about this, a rotary tool a sheet of plastic some drilling etc. and presto a usable wheel.&amp;nbsp; Optional might be to coat the wheel with epoxy and add a rubber band for traction.&amp;nbsp; Once the wheel is cut line up the servo horn with the screw hole and using a fine drill bit add 1-2 holes to match your horn.&amp;nbsp; and bingo.. a universal servo wheel. for like 10cents..&lt;br /&gt;
&lt;br /&gt;
Up next I&#39;ll hack those servos for continuous motion and mount them. So keep an eye on this article for more edits.</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/6306153538238409476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/6306153538238409476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6306153538238409476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6306153538238409476'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2012/05/turn-of-wheel.html' title='A turn of the wheel,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDqBaCz_xiPm7Hho5B3DtYDXyO319N3ZBJuTtjMlCyD5MsHNPSjPit8Zi_oZN9EzZZnFSA-NlAuM-iBa-UCvPzPS3ZKir2Ztz0wAE7mX54Nnmuxbnzzo8xSX5zWCadEU8njQnD7mWu_-Q/s72-c/2012-05-07-072750.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-4802000171500977374</id><published>2012-05-10T05:56:00.003-07:00</published><updated>2012-05-24T20:13:10.887-07:00</updated><title type='text'>A simple tank,</title><content type='html'>Ok,&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1C8Nj9dNNVDgWug4lJJBitAHBH9WEw5jcmMnMzuOLH8bfXmF8uzHY2d_f-MxogdCaC-6pzChQm2H5pxfUm-v_pFid5jEihPyPVRFNGf0RNjdVMOGEd0FxI41pFGLBSvNlppVR2qQLb10/s1600/2012-05-07-072334.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1C8Nj9dNNVDgWug4lJJBitAHBH9WEw5jcmMnMzuOLH8bfXmF8uzHY2d_f-MxogdCaC-6pzChQm2H5pxfUm-v_pFid5jEihPyPVRFNGf0RNjdVMOGEd0FxI41pFGLBSvNlppVR2qQLb10/s320/2012-05-07-072334.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Well this actually robot ended badly but only due to tamiya issues and a moment of stupidity. Never connect an Nano&#39;s vcc to ground and leave it powered while your wireing up your robot. But before I baked my arduino nano controller here is what I had going with this robot.&lt;br /&gt;
&lt;br /&gt;
Parts,&lt;br /&gt;
&amp;nbsp;Tamiya tank tread kit, two sheets of seafoam plastic cut to fit between the treads and be just long enough for the front and rear axles.&amp;nbsp; On the first level could be power, motors and sensors.&amp;nbsp; The second level mounted on 8 standoffs (stacked standoffs) was for the breadboard and controller.&amp;nbsp; Double-sided Velcro held the bread boards on.&amp;nbsp; To run the motors a trusty Sparkfun Motor Driver 1A Dual TB6612FNG wired up.&lt;br /&gt;
&lt;br /&gt;
I cut the plastic for this robot using a table mounted rotozip(or craftsman equivalent) (sorry its a bit of a secret at the moment.) The rest of the tools were simple, a low cost DMM (digital multi meter), screwdrivers, needle nose pliers, soldering iron and cross cutters.&lt;br /&gt;
&lt;br /&gt;
A simple program just to make it move back and forth, more elaborate code may get made once I fix the tamiya gearbox and drive wheel issue.&lt;br /&gt;
&lt;br /&gt;
With a couple of bump sensors or line tracer for example you could easily make this do all sorts of tasks and the cost is sub 100.00 USD. &lt;br /&gt;
&lt;br /&gt;
The C++ source code for the arduino ,&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;#define AIN1 7
#define AIN2 8
#define PWMA 9
#define BIN1 5
#define BIN2 4
#define PWMB 3

void setup()
{
&amp;nbsp; pinMode(AIN1, OUTPUT);
&amp;nbsp; pinMode(AIN2, OUTPUT);
&amp;nbsp; pinMode(PWMA, OUTPUT);
&amp;nbsp; 
&amp;nbsp; digitalWrite(AIN1, LOW);
&amp;nbsp; digitalWrite(AIN2,HIGH);
&amp;nbsp; digitalWrite(PWMA, HIGH);
&amp;nbsp; 
&amp;nbsp; pinMode(BIN1, OUTPUT);
&amp;nbsp; pinMode(BIN2, OUTPUT);
&amp;nbsp; pinMode(PWMB, OUTPUT);
&amp;nbsp; 
&amp;nbsp; digitalWrite(BIN1, LOW);
&amp;nbsp; digitalWrite(BIN2,HIGH);
&amp;nbsp; digitalWrite(PWMB, HIGH);
&amp;nbsp; Serial.begin(9600);

&amp;nbsp; establishContact();&amp;nbsp; // send a byte to establish contact until receiver responds 
}

void loop()
{
&amp;nbsp; if (Serial.available() &amp;gt; 0) {

&amp;nbsp; Serial.println(&quot;Forward&quot;);

&amp;nbsp; digitalWrite(AIN1, LOW);
&amp;nbsp; digitalWrite(AIN2,HIGH);
&amp;nbsp; digitalWrite(PWMA, 255);
&amp;nbsp; delay(1000);
&amp;nbsp; digitalWrite(BIN1, LOW);
&amp;nbsp; digitalWrite(BIN2,HIGH);
&amp;nbsp; digitalWrite(PWMB, 255);

&amp;nbsp; Serial.println(&quot;Reverse&quot;);

&amp;nbsp; delay(1000);
&amp;nbsp; digitalWrite(AIN1, HIGH);
&amp;nbsp; digitalWrite(AIN2,LOW);
&amp;nbsp; digitalWrite(PWMA, 255);
&amp;nbsp; digitalWrite(BIN1, HIGH);
&amp;nbsp; digitalWrite(BIN2,LOW);
&amp;nbsp; digitalWrite(PWMB, 255);
&amp;nbsp; delay(1000);
&amp;nbsp; }
}

void establishContact() {
&amp;nbsp; while (Serial.available() &amp;lt;= 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(&quot;0,0,0&quot;);&amp;nbsp;&amp;nbsp; // send an initial string
&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(300);
&amp;nbsp; }
}
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/4802000171500977374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/4802000171500977374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4802000171500977374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4802000171500977374'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2012/05/simple-tank.html' title='A simple tank,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1C8Nj9dNNVDgWug4lJJBitAHBH9WEw5jcmMnMzuOLH8bfXmF8uzHY2d_f-MxogdCaC-6pzChQm2H5pxfUm-v_pFid5jEihPyPVRFNGf0RNjdVMOGEd0FxI41pFGLBSvNlppVR2qQLb10/s72-c/2012-05-07-072334.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-1621849840292432594</id><published>2012-05-10T05:56:00.002-07:00</published><updated>2012-05-24T20:18:21.744-07:00</updated><title type='text'>Back at the bench, robotic arm anyone?</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Ok its been awhile I know,&lt;br /&gt;
&amp;nbsp;Before getting back on sensors and 
what not I decided to work on a few simple projects again.&amp;nbsp; Here we have
 a 4 servo robotic arm with a crude but usable claw.&amp;nbsp; Again simple materials, 
Futaba S3003&#39;s, the Arduino Duemilanove, an off the shelf dc adapter for 
power. Oh and my own special servo bracket prototypes, yes I killed my 
biped to make the arm.&amp;nbsp; Please forgive the claw its a crude quick cut, I
 have a much better idea brewing and make change this out soon.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirOik1nKT8ekAQVquSU3h5J7fIYDxZVRQC3zllkiqNKhjgyC85sJyJgXZ7cqmfD2FXvfp-IwHsCAW4fv7r1WOuhrgLLMBiO3Uxg-PlU9q_okMAx_J0D-HzEtRuytR_xcNjCKJqq7ci0Kc/s1600/2012-05-07-071147.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirOik1nKT8ekAQVquSU3h5J7fIYDxZVRQC3zllkiqNKhjgyC85sJyJgXZ7cqmfD2FXvfp-IwHsCAW4fv7r1WOuhrgLLMBiO3Uxg-PlU9q_okMAx_J0D-HzEtRuytR_xcNjCKJqq7ci0Kc/s320/2012-05-07-071147.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Wiring hookup,&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigNyiTxr2TZDI8eB4M1vwm_po7gDkZr787qI5NN22RvrK5yw9NVH_hgXAeHRDdgnDqi9PsYPGQvtUys4cp9CUj8Sc6XGTLQ_9Ui4YL9MNGvOzvmijBQuFGqAfh5mA7CvHeZjJ2x3guSfE/s1600/2012-05-07-071537.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigNyiTxr2TZDI8eB4M1vwm_po7gDkZr787qI5NN22RvrK5yw9NVH_hgXAeHRDdgnDqi9PsYPGQvtUys4cp9CUj8Sc6XGTLQ_9Ui4YL9MNGvOzvmijBQuFGqAfh5mA7CvHeZjJ2x3guSfE/s320/2012-05-07-071537.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Why a robotic arm? They are simple yet brilliant, easy to play with but just as challenging as a maze solver or legged robot if you want to do something more complex. The arduino in this case is acting as a fairly simple servo controller allowing a PC to control the positions of the servos.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Drawbacks?&lt;br /&gt;
&amp;nbsp;My rough prototypes are uneven and made of light weight aluminum so there is some wiggle as it moves.&amp;nbsp; Also the Futaba S3003 servos&#39;s aren&#39;t the highest torque but get the job done none the less.&lt;br /&gt;
&lt;br /&gt;
Future additions, when I replace the claw I&#39;ll add a fifth possibly 
sixth servo depending on weight.&amp;nbsp; Those will give it a more natural 
range of motion with a pan and tilt on right before the claw. I also am considering mixing an omap3 (gumstix) arm controller in with this one along with a camera and more sensors.&lt;br /&gt;
&lt;br /&gt;
Modified servo code for the arduino code, Note the servo.h line should have &amp;lt;&amp;gt; around the file but it errors out blogspot.&lt;br /&gt;
&lt;br /&gt;
The C++ source code for the arduino ,&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;/*

&amp;nbsp;* MultipleSerialServoControl

&amp;nbsp;* --------------

&amp;nbsp;*

&amp;nbsp;* Uses the Arduino Serial library

&amp;nbsp;*&amp;nbsp; (http://arduino.cc/en/Reference/Serial)

&amp;nbsp;* and the Arduino Servo library

&amp;nbsp;*&amp;nbsp; (http://arduino.cc/en/Reference/Servo)

&amp;nbsp;* to control multiple servos from a PC using a USB cable.

&amp;nbsp;*

&amp;nbsp;* Designed for use with the Python servo.py module

&amp;nbsp;*&amp;nbsp; (http://principialabs.com/arduino-python-4-axis-servo-control/)

&amp;nbsp;*

&amp;nbsp;* REQUIRED: Arduino 0017 or higher

&amp;nbsp;*&amp;nbsp;&amp;nbsp; Control up to 48 servos with Arduino Mega!

&amp;nbsp;*&amp;nbsp;&amp;nbsp; See the &quot;TO ADD SERVOS:&quot; comments below.

&amp;nbsp;*

&amp;nbsp;* Created 23 December 2009

&amp;nbsp;* copyleft 2009 Brian D. Wendt

&amp;nbsp;* http://principialabs.com/

&amp;nbsp;*

&amp;nbsp;*/

&amp;nbsp; 

// Import the Arduino Servo library

#include Servo.h 

#define NBR_SERVOS 4

#define FIRST_SERVO_PIN 9



// Create a Servo object for each servo

&amp;nbsp; 

&amp;nbsp; 

// TO ADD SERVOS:

//&amp;nbsp;&amp;nbsp; Servo servo5;

//&amp;nbsp;&amp;nbsp; etc...

&amp;nbsp; 

// Common servo setup values

int minPulse = 700;&amp;nbsp;&amp;nbsp; // minimum servo position, us (microseconds)

int maxPulse = 2300;&amp;nbsp; // maximum servo position, us

//

// User input for servo and position

int userInput[3];&amp;nbsp;&amp;nbsp;&amp;nbsp; // raw input from serial buffer, 3 bytes

int startbyte;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // start byte, begin reading input

int pos = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // servo angle 0-180

int servo;

int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // iterator

int v;

Servo Servos[NBR_SERVOS];

int lpos[NBR_SERVOS];

void setup()

{

&amp;nbsp; for( int i =0; i &amp;lt; NBR_SERVOS; i++)

&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].attach( FIRST_SERVO_PIN +i);

&amp;nbsp; }



&amp;nbsp; // Open the serial connection, 9600 baud

&amp;nbsp; Serial.begin(9600);

&amp;nbsp; //Sweep test

&amp;nbsp; Serial.println (&quot;Sweep test&quot;);

&amp;nbsp; for( int i=0; i&lt;nbr_servos; i++)&lt;br=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(0);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(45);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(45);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(90);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(90);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(135);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(135);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(180);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(180);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;Servo,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print(&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(90);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[i].write(90);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell servo to go to position in variable &#39;pos&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(1000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[i]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
int i = 0;
}
&amp;nbsp; 
void loop()
{
&amp;nbsp; // Wait for serial input (min 3 bytes in buffer)
&amp;nbsp; if (Serial.available() &amp;gt; 2) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Read the first byte
&amp;nbsp;&amp;nbsp;&amp;nbsp; startbyte = Serial.read();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // If it&#39;s really the startbyte (255) ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println (&quot;checking serial&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (startbyte == 255) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (&quot;Got servo cmd&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ... then get the next two bytes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i=0;i&amp;lt;2;i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userInput[i] = Serial.read();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // First byte = servo to move?
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo = userInput[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Second byte = which position?
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pos = userInput[1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Packet error checking and recovery
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pos == 255) { servo = 255; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Assign new position to appropriate servo
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (servo &amp;lt;= NBR_SERVOS)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Servos[servo].write(pos);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (15);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpos[servo]=pos;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (startbyte);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (servo);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (&quot;,&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.print (pos);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println (&quot;Sent&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (startbyte == 254) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ... state stub&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

}&lt;/nbr_servos;&gt;
&lt;/pre&gt;
&lt;br /&gt;
Sample ncurses / python source code for controlling the arduino from a PC,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;#!/usr/bin/env python

import time, sys, serial, curses

from os import system

#log=&quot;./servopos.log&quot;

#logfile=open(log,&quot;w&quot;)



#set up the serial port for action (0==COM1==ttyS0)

if &#39;comport&#39; not in dir():

&amp;nbsp;comport=&quot;/dev/ttyUSB0&quot;



if &#39;baudrate&#39; not in dir():

&amp;nbsp;baudrate=&quot;9600&quot;



packet=0

servo=list()

max=5

first=0



while first &amp;lt;= max:

&amp;nbsp;servo.append([first,&#39;90&#39;])

&amp;nbsp;first=first+1



def sercon(baudrate,comport):

&amp;nbsp;&amp;nbsp;&amp;nbsp; global ser

&amp;nbsp;&amp;nbsp;&amp;nbsp; ser=serial.Serial(comport)

&amp;nbsp;&amp;nbsp;&amp;nbsp; ser.baudrate=baudrate



def setpos(n,angle):

&amp;nbsp;&amp;nbsp;&amp;nbsp; packet=chr(255)+chr(n)+chr(angle)

&amp;nbsp;&amp;nbsp;&amp;nbsp; ser.write(packet)

&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd=str(n)+&quot;,&quot;+str(angle)+&quot;\n&quot;

&amp;nbsp;&amp;nbsp;&amp;nbsp; #logfile.write(cmd)









###Begin Main###

def main(stdscr):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def get_param(prompt_string):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curses.echo()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.clear()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.border(1)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(2, 2, prompt_string)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.refresh()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = stdscr.getstr(10, 10, 60)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return input



&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; global log,logfile,baudrate,comport

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = 0

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sercon(baudrate,comport)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while x != ord(&#39;4&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.clear()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.border(0)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(1, 1, &#39;Curses Servo control by Auzie Morgan&#39;)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(2, 2, &#39;(1)-change Servo control com:&#39;+str(comport)+&#39; baud:&#39;+str(baudrate))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #stdscr.addstr(3, 2, &#39;(2)-change logfile:&#39;+str(logfile)+&#39; &#39;)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(4, 4, &#39;Servo 0 =(a+/z-) 5 Current:&#39;+str(servo[0][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(5, 4, &#39;Servo 1 =(s+/x-) 5 Current:&#39;+str(servo[1][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(6, 4, &#39;Servo 2 =(d+/c-) 5 Current:&#39;+str(servo[2][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(7, 4, &#39;Servo 3 =(f+/v-) 5 Current:&#39;+str(servo[3][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(8, 4, &#39;Servo 4 =(g+/b-) 5 Current:&#39;+str(servo[4][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(9, 4, &#39;Servo 5 =(h+/n-) 5 Current:&#39;+str(servo[5][1]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.addstr(10, 4, &quot;4 - Exit&quot;)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.refresh()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = stdscr.getch()



&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;a&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[0][1]=int(servo[0][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[0][0],servo[0][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;z&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[0][1]=int(servo[0][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[0][0],servo[0][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;s&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[1][1]=int(servo[1][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[1][0],servo[1][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;x&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[1][1]=int(servo[1][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[1][0],servo[1][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;d&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[2][1]=int(servo[2][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[2][0],servo[2][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;c&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[2][1]=int(servo[2][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[2][0],servo[2][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;f&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[3][1]=int(servo[3][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[3][0],servo[3][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;v&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[3][1]=int(servo[3][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[3][0],servo[3][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;g&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[4][1]=int(servo[4][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[4][0],servo[4][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;b&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[4][1]=int(servo[4][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[4][0],servo[4][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;h&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[5][1]=int(servo[5][1])+5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[5][0],servo[5][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;n&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servo[5][1]=int(servo[5][1])-5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setpos(servo[5][0],servo[5][1])

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;1&#39;):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ser.close()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; baudrate=get_param(&quot;Type new baudrate:&quot;)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comport=get_param(&quot;Type new comport:&quot;)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sercon(baudrate,comport)

##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x == ord(&#39;2&#39;):

##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logfile.close()

##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log=get_param(&quot;Type new logfile name:&quot;)

##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logfile=open(log,&quot;w&quot;)

## 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdscr.clear()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curses.echo()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curses.endwin()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #logfile.close()

###End Main###

curses.wrapper(main)

exit()



&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/1621849840292432594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/1621849840292432594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1621849840292432594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1621849840292432594'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2012/05/back-at-bench-robotic-arm-anyone.html' title='Back at the bench, robotic arm anyone?'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirOik1nKT8ekAQVquSU3h5J7fIYDxZVRQC3zllkiqNKhjgyC85sJyJgXZ7cqmfD2FXvfp-IwHsCAW4fv7r1WOuhrgLLMBiO3Uxg-PlU9q_okMAx_J0D-HzEtRuytR_xcNjCKJqq7ci0Kc/s72-c/2012-05-07-071147.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-3934954933689198341</id><published>2011-05-23T07:18:00.000-07:00</published><updated>2012-05-24T20:22:06.191-07:00</updated><title type='text'>First go around with MMA7361 from Modern Device,</title><content type='html'>Ok, I added pics of hooking this &lt;a href=&quot;http://shop.moderndevice.com/products/mma7260qt-3-axis-accelerometer&quot;&gt;MMA7361&lt;/a&gt; 3-axis accelerometer module and here are my notes and some &lt;a href=&quot;http://www.cutedigi.com/product_info.php?products_id=4235&quot;&gt;Arduino source code I ran on my Arduino Nano&lt;/a&gt;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAraO8HTJ9G_8X3dkiaF3sSLqFq2edmY49YXb9uHHWmHUDG0rI7QAPugIxdLWfdnWWjzj6p4-lx7RuNFpxPSivJ6cdAqR3fiAZyqX7xPU_Xf0yywwjBjxFGx6fk4ptJVKOjToYihwONCE/s1600/img_1142.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAraO8HTJ9G_8X3dkiaF3sSLqFq2edmY49YXb9uHHWmHUDG0rI7QAPugIxdLWfdnWWjzj6p4-lx7RuNFpxPSivJ6cdAqR3fiAZyqX7xPU_Xf0yywwjBjxFGx6fk4ptJVKOjToYihwONCE/s320/img_1142.jpg&quot; width=&quot;320&quot; /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
First up, for what ever reason on my nano I needed both main header pin sets hooked up. Vin didn&#39;t cut it and the main sensor side G either.&amp;nbsp; So I used V3.3 / G on the other side of the board.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_XA9X3awGCBKHbQMv6-RBttzogVNFKEXyHyf8Ba8mJ41WP3lf0w9GvDWTtQLn9CSzcBNex4CX_t-whZ0Zl2N3kLbDxP4KHRAClUzF3LkedHkAqBVugJQfk7lRpdeQ_O-6mPj_tRJh62I/s1600/img_1145.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_XA9X3awGCBKHbQMv6-RBttzogVNFKEXyHyf8Ba8mJ41WP3lf0w9GvDWTtQLn9CSzcBNex4CX_t-whZ0Zl2N3kLbDxP4KHRAClUzF3LkedHkAqBVugJQfk7lRpdeQ_O-6mPj_tRJh62I/s320/img_1145.jpg&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ok A0,1 were my sharp IR Rangefinder and a photo resistor, so for those who don&#39;t have other stuff you probably will just go from 0-2 on your analog pins.. &lt;br /&gt;
&lt;br /&gt;
The C++ source code for the arduino ,&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;void setup() {
        Serial.begin(9600);
    }

    void loop() {
        int sensorValue0 = analogRead(0);  //  x pin on 0 etc.
        int sensorValue1 = analogRead(1);  //  x pin on 0 etc.
        int sensorValue2 = analogRead(2);  //  x pin on 0 etc.
        int sensorValue3 = analogRead(3);
        int sensorValue4 = analogRead(4);
        Serial.print(&quot;pv,  &quot;);
        Serial.print(sensorValue0, DEC);
        Serial.print(&quot;,RF,  &quot;);
        Serial.print(sensorValue1, DEC);
        Serial.print(&quot;,X,   &quot;);
        Serial.print(sensorValue2, DEC);
        Serial.print(&quot;,Y,   &quot;);
        Serial.print(sensorValue3, DEC);
        Serial.print(&quot;,Z,   &quot;);
        Serial.println(sensorValue4, DEC);
    }&amp;nbsp;&lt;/pre&gt;
&lt;br /&gt;
The output (if everything is connected correctly) should be a set of numbers that&lt;br /&gt;
range from positive to negative based on the amount of movement on each axis.&lt;br /&gt;
This example is really for planing only and to be honest I really need to sit back down with it.&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/3934954933689198341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/3934954933689198341' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3934954933689198341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3934954933689198341'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/05/first-go-around-with-mma7361-from.html' title='First go around with MMA7361 from Modern Device,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAraO8HTJ9G_8X3dkiaF3sSLqFq2edmY49YXb9uHHWmHUDG0rI7QAPugIxdLWfdnWWjzj6p4-lx7RuNFpxPSivJ6cdAqR3fiAZyqX7xPU_Xf0yywwjBjxFGx6fk4ptJVKOjToYihwONCE/s72-c/img_1142.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-2723134963517202413</id><published>2011-05-04T10:23:00.000-07:00</published><updated>2011-05-04T10:42:51.465-07:00</updated><title type='text'>Still chasing my linksprites electronic tail, added batteries though :)</title><content type='html'>&lt;pre class=&quot;brush: cpp&quot;&gt;/* Alpha code,

 * With input from HomeBrew Robotics Club 

 * members, Auzie Morgan and Howard Wang.

 */


// IR Rangefinder variables
#include &lt;Servo.h&gt;
float inches; //Used in reading rangefinder
int proxsens = 1;     // Used in reading rangefinder
int pos = 0;          // IR servo angle 0-180
int dir = 0;          // IRScan direction 0(f),1(l),2(r)
int posmax = 115;     // IR servo max angle 0-180
int posmin = 55;      // IR servo min angle 0-180
Servo svsensor;       // IRSensor Servo init.

//Motor variables
int dur=2500; //Estimated 6inch move
int pwr=255;  //PWM Rate for motor drivers
const int motorAPin1 = 3;   // AIN1
const int motorAPin2 = 4;   // AIN2
const int motorBPin1 = 6;  // BIN1
const int motorBPin2 = 7;  // BIN
const int PWMA = 2;
const int PWMB = 8;

//Other variables
int light;       // Photo resistor variable
int lightPin = 0;     // Photo resistor 
int i=0;       // Iterator1
int ir=0;       // Iterator1
int j=0;       // Iterator2
int irfwd=0;
int irlft=0;
int irrgt=0;
  

void setup(){

  Serial.println(&quot;setup&quot;);


  Serial.begin(9600);

  //establishContact();

  // set outputs:

  pinMode(motorAPin1, OUTPUT);

  pinMode(motorAPin2, OUTPUT);

  pinMode(motorBPin1, OUTPUT);

  pinMode(motorBPin2, OUTPUT);

  pinMode(PWMA, OUTPUT);

  pinMode(PWMB, OUTPUT);
  svsensor.attach(9);
}

 

//Setting up functions for testing

void stp() { 

  Serial.println(&quot;Stopping&quot;);

  digitalWrite(motorAPin1, LOW);

  digitalWrite(motorAPin2, LOW);

  digitalWrite(motorBPin1, LOW);

  digitalWrite(motorBPin2, LOW);

  analogWrite(PWMA, 0);

  analogWrite(PWMB, 0);

  delay(500);

}

 

void fwd(int p, int d) {
i=0;
j=0;
d=d;
inches=IRSensor(0);
while (i&lt;=d ){
  Serial.print(&quot;Forward,&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(i);

  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, HIGH);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, HIGH);

  analogWrite(PWMA, p);
  analogWrite(PWMB, p);

  delay(10);
  if (j==80){
   inches=IRSensor(0);
   j=0;
  } 
  i++;
  j++;
 if (inches &lt; 15){
  rev(p,500);
  return; 
 }
 }
  stp();

}

 

void rev(int p, int d){

  Serial.print(&quot;Reverse&quot;);

  Serial.print(d);

  Serial.print(&quot;,&quot;);

  Serial.println(p);

  digitalWrite(motorAPin1, HIGH);

  digitalWrite(motorAPin2, LOW);

  digitalWrite(motorBPin1, HIGH);

  digitalWrite(motorBPin2, LOW);

  analogWrite(PWMA, p);

  analogWrite(PWMB, p);

  delay(d);

  stp();

}

 

void rgt(int p, int d){
i=0;
j=0;
d=d;
inches=IRSensor(2);
while (i&lt;=d ){

    Serial.print(&quot;Right,&quot;);
    Serial.print(d);
    Serial.print(&quot;, &quot;);
    Serial.print(p);
    Serial.print(&quot;, &quot;);
    Serial.print(j);
    Serial.print(&quot;, &quot;);
    Serial.println(i);

    digitalWrite(motorAPin1, LOW);

    digitalWrite(motorAPin2, HIGH);

    digitalWrite(motorBPin1, HIGH);

    digitalWrite(motorBPin2, LOW);

    analogWrite(PWMA, p);

    analogWrite(PWMB, p);

  delay(10);
  if (j==80){
   inches=IRSensor(2);
   j=0;
  } 
  i++;
  j++;
 if (inches &lt; 15){
  lft(p,500);
  stp();
  return; 
 }
 }

    stp();

}

 

void lft(int p, int d){

i=0;
j=0;
d=d;
inches=IRSensor(1);
while (i&lt;=d || inches &lt;=15){
    Serial.print(&quot;Left, &quot;);
    Serial.print(d);
    Serial.print(&quot;, &quot;);
    Serial.print(p);
    Serial.print(&quot;, &quot;);
    Serial.print(j);
    Serial.print(&quot;, &quot;);
    Serial.println(i);

    digitalWrite(motorAPin1, HIGH);

    digitalWrite(motorAPin2, LOW);

    digitalWrite(motorBPin1, LOW);

    digitalWrite(motorBPin2, HIGH);

    analogWrite(PWMA, p);

    analogWrite(PWMB, p);

  delay(10);
  if (j==80){
   inches=IRSensor(1);
   j=0;
  } 
  i++;
  j++;
 if (inches &lt; 15){
  rgt(p,500);
  stp();
  return; 
 }
 }

    stp();

}


int IRSensor(int dir){

float inches;
float inchesavg;
inches=0;
inchesavg=0;
if (dir==0){
posmax = 105;     // IR servo max angle 0-180
posmin = 85;      // IR servo min angle 0-180
} else if (dir==1){
posmax = 85;     // IR servo max angle 0-180
posmin = 55;      // IR servo min angle 0-180
} else if (dir==2){
posmax = 130;     // IR servo max angle 0-180
posmin = 115;      // IR servo min angle 0-180
}
ir=1;
for(pos = posmin; pos &lt;= posmax; pos += 5)  // goes from 0 degrees to 180 degrees 
  { 
   inches = 0.393700787*(9462/(analogRead(proxsens)-16.92));
   inchesavg=inchesavg+inches;
   svsensor.write(pos);
   Serial.print(inches);
   Serial.print(&quot;,&quot;);
   Serial.println(pos);
   ir=ir+1;
   delay (100);
  }
inches=inchesavg/ir;
if (inches &gt;= 80){
  inches=80;
}
if (inches &lt;=9){
  inches=9;
}
ir=0;
Serial.print(&quot;Average=&quot;);
Serial.println(inches);
svsensor.write(90);
return inches;

}


void status(){
      Serial.print(&quot;Status:&quot;);
      Serial.print(light);
      Serial.print(&quot;,&quot;);
      Serial.println(inches);
      Serial.print(&quot;,&quot;);
      Serial.println(irfwd);
      Serial.print(&quot;,&quot;);
      Serial.println(irlft);
      Serial.print(&quot;,&quot;);
      Serial.println(irrgt);
}

void loop()

{


  

  Serial.print(&quot;Main Loop&quot;);
int fwdcnt=0;

  

  Serial.println(&quot;Going auto&quot;);
inches=IRSensor(0);
Serial.print(&quot;inches=&quot;);
Serial.println(inches);
while ( inches &gt;= 9) {
      light=analogRead(lightPin);
      irfwd=IRSensor(0);
      irlft=IRSensor(1);
      irrgt=IRSensor(2);
      status();
      if ( irfwd &gt;=25 ){
        dir=0;
      } else if (irlft &gt;= 50){
        dir=1;
      } else if( fwdcnt &gt; 5) {
        rgt(pwr,dur);
        fwdcnt=0;
      } else {
        dir=2;
      }    
      
      
      if ( dir==0 ){
          Serial.println(&quot;Forward looks clear&quot;);
          fwd(pwr,800);
      } else if ( dir==1 ){
          lft(pwr,800);
        
      } else if (dir==2) {
          fwd(pwr,800);
      }
      if (inches == 9){
        Serial.println(&quot;Probably too close to something..&quot;);
       rev(pwr,500);
      } else if (inches == 80){
        Serial.println(&quot;Wide open ahead or range error&quot;);
        fwd(pwr,500);
      }


fwdcnt=fwdcnt+1;
}


}

   

  

 

  

void establishContact() {

  while (Serial.available() &lt;= 0) {

    Serial.println(&quot;helo&quot;);   // send an initial string

    delay(300);

  }

}



&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/2723134963517202413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/2723134963517202413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2723134963517202413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2723134963517202413'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/05/still-chasing-my-linksprites-electronic.html' title='Still chasing my linksprites electronic tail, added batteries though :)'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-8450587572244680083</id><published>2011-04-26T10:01:00.000-07:00</published><updated>2011-04-27T14:42:07.189-07:00</updated><title type='text'>More tinkering with the linksprite, updated</title><content type='html'>Ok, now I&#39;m a bit happier with the code but worth sharing,&lt;br /&gt;
This is a sensor modified fixed pattern, still bumps into things but then backs out of most jams.  Next I&#39;ll weave the sensor read deeper into the movement routines.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;390&quot; src=&quot;http://www.youtube.com/embed/AEt5XPKBlxA&quot; title=&quot;YouTube video player&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;/*
/*

 * auzie1.c

 *

 */


// IR Rangefinder variables
#include &lt;Servo.h&gt;
float inches; //Used in reading rangefinder
int proxsens = 1;     // Used in reading rangefinder
int pos = 0;          // IR servo angle 0-180
int dir = 0;          // IRScan direction 0(f),1(l),2(r)
int posmax = 115;     // IR servo max angle 0-180
int posmin = 55;      // IR servo min angle 0-180
Servo svsensor;       // IRSensor Servo init.

//Motor variables
int dur=2500; //Estimated 6inch move
int pwr=255;  //PWM Rate for motor drivers
const int motorAPin1 = 3;   // AIN1
const int motorAPin2 = 4;   // AIN2
const int motorBPin1 = 6;  // BIN1
const int motorBPin2 = 7;  // BIN
const int PWMA = 2;
const int PWMB = 8;

//Other variables
int light;       // Photo resistor variable
int lightPin = 0;     // Photo resistor 
int i=0;       // Iterator1
int j=0;       // Iterator2
  

void setup(){

  Serial.println(&quot;setup&quot;);


  Serial.begin(9600);

  //establishContact();

  // set outputs:

  pinMode(motorAPin1, OUTPUT);

  pinMode(motorAPin2, OUTPUT);

  pinMode(motorBPin1, OUTPUT);

  pinMode(motorBPin2, OUTPUT);

  pinMode(PWMA, OUTPUT);

  pinMode(PWMB, OUTPUT);
  svsensor.attach(9);
}

 

//Setting up functions for testing

void stp() { 

  Serial.println(&quot;Stopping&quot;);

  digitalWrite(motorAPin1, LOW);

  digitalWrite(motorAPin2, LOW);

  digitalWrite(motorBPin1, LOW);

  digitalWrite(motorBPin2, LOW);

  analogWrite(PWMA, 0);

  analogWrite(PWMB, 0);

  delay(500);

}

 

void fwd(int p, int d) {
i=0;
j=0;
d=d/10;

while (i&lt;=d &amp;&amp; inches &gt; 10){
  Serial.print(&quot;Forward,&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(p);

  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, HIGH);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, HIGH);

  analogWrite(PWMA, p);
  analogWrite(PWMB, p);

  delay(10);
  if (j==80){
   inches=IRSensor(0);
   j=0;
  }
  i=i+1;
  j=j+1;
  }
  stp();

}

 

void rev(int p, int d){

  Serial.print(&quot;Reverse&quot;);

  Serial.print(d);

  Serial.print(&quot;,&quot;);

  Serial.println(p);

  digitalWrite(motorAPin1, HIGH);

  digitalWrite(motorAPin2, LOW);

  digitalWrite(motorBPin1, HIGH);

  digitalWrite(motorBPin2, LOW);

  analogWrite(PWMA, p);

  analogWrite(PWMB, p);

  delay(d);

  stp();

}

 

void rgt(int p, int d){

    Serial.print(&quot;Right,&quot;);

    Serial.print(d);

    Serial.print(&quot;,&quot;);

    Serial.println(p);

    digitalWrite(motorAPin1, LOW);

    digitalWrite(motorAPin2, HIGH);

    digitalWrite(motorBPin1, HIGH);

    digitalWrite(motorBPin2, LOW);

    analogWrite(PWMA, p);

    analogWrite(PWMB, p);

    delay(d);

    stp();

}

 

void lft(int p, int d){

    Serial.print(&quot;Left,&quot;);

    Serial.print(d);

    Serial.print(&quot;,&quot;);

    Serial.println(p);

    digitalWrite(motorAPin1, HIGH);

    digitalWrite(motorAPin2, LOW);

    digitalWrite(motorBPin1, LOW);

    digitalWrite(motorBPin2, HIGH);

    analogWrite(PWMA, p);

    analogWrite(PWMB, p);

    delay(d);

    stp();

}


int IRSensor(int dir){

float inches;
float inchesavg;
inches=0;
inchesavg=0;
if (dir==0){
posmax = 105;     // IR servo max angle 0-180
posmin = 85;      // IR servo min angle 0-180
} else if (dir==1){
posmax = 85;     // IR servo max angle 0-180
posmin = 55;      // IR servo min angle 0-180
} else if (dir==2){
posmax = 115;     // IR servo max angle 0-180
posmin = 105;      // IR servo min angle 0-180
}
i=1;
for(pos = posmin; pos &lt;= posmax; pos += 5)  // goes from 0 degrees to 180 degrees 
  { 
   inches = 0.393700787*(9462/(analogRead(proxsens)-16.92));
   inchesavg=inchesavg+inches;
   svsensor.write(pos);
   Serial.print(inches);
   Serial.print(&quot;,&quot;);
   Serial.println(pos);
   i=i+1;
   delay (100);
  }
inches=inchesavg/i;
if (inches &gt;= 80){
  inches=80;
}
if (inches &lt;=10){
  inches=10;
}
Serial.print(&quot;Average=&quot;);
Serial.println(inches);
return inches;

}



void loop()

{


  

  Serial.print(&quot;Main Loop&quot;);


  

  Serial.println(&quot;Going auto&quot;);
inches=IRSensor(0);
Serial.print(&quot;inches=&quot;);
Serial.println(inches);
while ( inches &gt; 10) {
      light=analogRead(lightPin);
      if ( IRSensor(0) &gt; 10 &amp;&amp; IRSensor(0) &lt; 80 ){
        Serial.println(&quot;Forward looks clear&quot;);
        fwd(pwr,dur);
      } else if (IRSensor(1) &gt; 25 &amp;&amp; IRSensor(1) &lt; 80){
        Serial.println(&quot;Right looks clear&quot;);
        rgt(pwr,dur);
      } else if (IRSensor(2) &gt; 25 &amp;&amp; IRSensor(2) &lt; 80){
        Serial.println(&quot;Left looks clear&quot;);
        lft(pwr,dur);
      }
      if (IRSensor(0) == 10){
        Serial.println(&quot;Probably too close to something..&quot;);
       rev(pwr,dur);
      } else if (IRSensor(0) == 80){
        Serial.println(&quot;Wide open ahead or range error&quot;);
        fwd(pwr,dur);
      }

      Serial.print(&quot;Status:&quot;);

      Serial.print(light);

      Serial.print(&quot;,&quot;);

      Serial.println(inches);

}


}

   

  

 

  

void establishContact() {

  while (Serial.available() &lt;= 0) {

    Serial.println(&quot;helo&quot;);   // send an initial string

    delay(300);

  }

}



&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/8450587572244680083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/8450587572244680083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8450587572244680083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8450587572244680083'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/04/more-tinkering-with-linksprite.html' title='More tinkering with the linksprite, updated'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/AEt5XPKBlxA/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-3198917610412852335</id><published>2011-04-15T10:35:00.000-07:00</published><updated>2011-04-15T12:56:45.779-07:00</updated><title type='text'>A robotic chicken in every pot, News from the Stanford robotics block party,</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;While a bit smaller this year, still impressive.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;As you may or may not know I have been predicting more and more ARM showing up in robotics. So all sorts of folks putting ARM boards in charge of their machines, Neto Robotics and others showing off their ARM&#39;d bots :)&amp;nbsp; Lots of kinect projects doing object tracking, recognition, area mapping and more.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;No sine of any terminators yet though one or two had nerf / squirt guns..&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;AnyBots,&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;Really cool tele presence robots, nice design reasonable prices.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_C7Lvv_MCFskvTuvqhYObTymCK5vsNDIBBMWkRyPj4YZKMUJTRjgUgXUIK2VkLBCcU-6l1pF6vQfaWd9QRK8F9i1_fnOXN48wypkJyiExl7SCzUV0lLicL1IboCve98AwL5QDddCyQ1U/s1600/IMG_1084.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_C7Lvv_MCFskvTuvqhYObTymCK5vsNDIBBMWkRyPj4YZKMUJTRjgUgXUIK2VkLBCcU-6l1pF6vQfaWd9QRK8F9i1_fnOXN48wypkJyiExl7SCzUV0lLicL1IboCve98AwL5QDddCyQ1U/s320/IMG_1084.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Homebrew friends Vanadium Labs.. kinect + ROS = monkey see monkey do robots!? Slick.. This project copied people who stood in range of the optics.. &lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm1eSI-8pmC72uVgV-kClfKqF-LfYBoBhp5R5giKsuUB6-sFanvZeMH4JUibQMibw59jExLZ8IAqLRAJAqE07lFFMQ4s2GOWz7iGjjiBJ-IEMp_a9Qz7Etx1B95d1X7-sTI5GBLuN2-2c/s1600/IMG_1083.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm1eSI-8pmC72uVgV-kClfKqF-LfYBoBhp5R5giKsuUB6-sFanvZeMH4JUibQMibw59jExLZ8IAqLRAJAqE07lFFMQ4s2GOWz7iGjjiBJ-IEMp_a9Qz7Etx1B95d1X7-sTI5GBLuN2-2c/s320/IMG_1083.JPG&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;And on the inside, Volkswagons Darpa car ..&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOgsdpAhs9Wc7WAvbsTlynlSI-6V_htgQPn69V_JrSOSyUQXo6sTZQEBIzgrNwkdfF4p7RZx2Zloz90ckNcDWuNJhlyzHs7RwDIkRG1naSTO24zU4Iuu1ZdtAA6dYwGMZAu0OS7HeQ9JM/s1600/IMG_1085.JPG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOgsdpAhs9Wc7WAvbsTlynlSI-6V_htgQPn69V_JrSOSyUQXo6sTZQEBIzgrNwkdfF4p7RZx2Zloz90ckNcDWuNJhlyzHs7RwDIkRG1naSTO24zU4Iuu1ZdtAA6dYwGMZAu0OS7HeQ9JM/s320/IMG_1085.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Various stanford projects in autonomous driving..&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhYga_TcTYASwqwQUfQHj6PYCKQfkaxo-LEd31LNxdx9O5V9dq1-xEd1vn8fVmBdzPqCzDL9oC0400Ue5mHithgmpLqstwhTl_95vPPms62cVBdikqIjtCns2bexBruPfw6tXvHwPdcg/s1600/IMG_1082.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhYga_TcTYASwqwQUfQHj6PYCKQfkaxo-LEd31LNxdx9O5V9dq1-xEd1vn8fVmBdzPqCzDL9oC0400Ue5mHithgmpLqstwhTl_95vPPms62cVBdikqIjtCns2bexBruPfw6tXvHwPdcg/s320/IMG_1082.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Adept&#39;s demos were also cool..&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7L0n0fUZ8ddU2nKenCAwySzcPEiSK41kii9d4khScm_1blPTzNCudfPxhyphenhyphen9MpA2RMygrQnxtPSxdkV81phnCAwDV9PyOIRhBY2gRVMf0SkC2UFvLO03iuloY1m4usUXy8VwUBnwgCIA8/s1600/IMG_1080.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7L0n0fUZ8ddU2nKenCAwySzcPEiSK41kii9d4khScm_1blPTzNCudfPxhyphenhyphen9MpA2RMygrQnxtPSxdkV81phnCAwDV9PyOIRhBY2gRVMf0SkC2UFvLO03iuloY1m4usUXy8VwUBnwgCIA8/s320/IMG_1080.JPG&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;The San Jose tech museum had a slick vintage robot running amok.. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguFWl-sEeefOrZHvyWXYzeSbFGLJUlVy9P-QGnrGmyH8at9VrRQPkxz8POK1s-Bedbguho9qP3ilhS78VOgQ92dRLqXz2cj2bTtBewZmzgMdsstpo2ppn8u9QKZHIn099HPzxWrjnnsVo/s1600/IMG_1079.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguFWl-sEeefOrZHvyWXYzeSbFGLJUlVy9P-QGnrGmyH8at9VrRQPkxz8POK1s-Bedbguho9qP3ilhS78VOgQ92dRLqXz2cj2bTtBewZmzgMdsstpo2ppn8u9QKZHIn099HPzxWrjnnsVo/s320/IMG_1079.JPG&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/3198917610412852335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/3198917610412852335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3198917610412852335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3198917610412852335'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/04/robotic-chicken-in-every-pot-news-from.html' title='A robotic chicken in every pot, News from the Stanford robotics block party,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_C7Lvv_MCFskvTuvqhYObTymCK5vsNDIBBMWkRyPj4YZKMUJTRjgUgXUIK2VkLBCcU-6l1pF6vQfaWd9QRK8F9i1_fnOXN48wypkJyiExl7SCzUV0lLicL1IboCve98AwL5QDddCyQ1U/s72-c/IMG_1084.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-8565435050890522806</id><published>2011-03-23T15:20:00.000-07:00</published><updated>2011-03-23T15:20:23.301-07:00</updated><title type='text'>This TED about Garrett Lisi just must be shared,</title><content type='html'>&lt;a href=&quot;http://www.ted.com/talks/garrett_lisi_on_his_theory_of_everything.html&quot;&gt;Garret Lisi theory of everything&lt;/a&gt;&lt;br /&gt;
&lt;object width=&quot;446&quot; height=&quot;326&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://video.ted.com/assets/player/swf/EmbedPlayer.swf&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;param name=&quot;bgColor&quot; value=&quot;#ffffff&quot;&gt;&lt;/param&gt;&lt;param name=&quot;flashvars&quot; value=&quot;vu=http://video.ted.com/talks/dynamic/GarrettLisi_2008-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/GarrettLisi-2008.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=371&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=garrett_lisi_on_his_theory_of_everything;year=2008;theme=to_boldly_go;theme=unconventional_explanations;event=TED2008;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;&quot; /&gt;&lt;embed src=&quot;http://video.ted.com/assets/player/swf/EmbedPlayer.swf&quot; pluginspace=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; bgColor=&quot;#ffffff&quot; width=&quot;446&quot; height=&quot;326&quot; allowFullScreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; flashvars=&quot;vu=http://video.ted.com/talks/dynamic/GarrettLisi_2008-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/GarrettLisi-2008.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=371&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=garrett_lisi_on_his_theory_of_everything;year=2008;theme=to_boldly_go;theme=unconventional_explanations;event=TED2008;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
I feel this is as close as we have come to figuring &quot;everything&quot; out..</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/8565435050890522806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/8565435050890522806' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8565435050890522806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8565435050890522806'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/03/this-ted-about-garrett-lisi-just-must.html' title='This TED about Garrett Lisi just must be shared,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-4161303210846524717</id><published>2011-02-18T09:50:00.000-08:00</published><updated>2011-02-18T09:50:59.084-08:00</updated><title type='text'>This weeks rebuilds, programming to follow</title><content type='html'>Ok, &lt;br /&gt;
Now that I have two Arduino controllers and two Sharp IR Range finders I felt it was time for some rebuilds!  Meet Stubby and my Linksprite based rover.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIOqzrqvdvPv1i_-oyusoNNNtyPrTmKjf6vzt0_DA8ST8AOVd19BVU6xTBM7lSNviBFqwsXZKG5ZYUeOzt6FqdrUXZpUpFNvTPgmuvEqHMW-k8yy-AcySga2bT59DTna4_btD57Uo05M4/s1600/photo%25282%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIOqzrqvdvPv1i_-oyusoNNNtyPrTmKjf6vzt0_DA8ST8AOVd19BVU6xTBM7lSNviBFqwsXZKG5ZYUeOzt6FqdrUXZpUpFNvTPgmuvEqHMW-k8yy-AcySga2bT59DTna4_btD57Uo05M4/s320/photo%25282%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;The linksrpite got one of my early servo brackets as a panning mount for its sensor.&lt;br /&gt;
&lt;br /&gt;
While the 6 servo biped got a reduction in complexity, I said I was going to do this along time ago.&amp;nbsp; Well now it begins!&amp;nbsp; A 4 servo biped in spirit of another clever guys post on indestructibles.&amp;nbsp; With a fith servo for panning the IR Rangefinder.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO67Q2nAc6Xny4aiZOCEDUxgZBmfsxG1lJN_FeR5J0ngAnIprp73dgLXygCfSl_rqphm81onKVCAEF9qFj0P6U-sCVPK4O_YUPQ7FdR9rVbWFIyHFNctp16h8vi7pQ_-6zeLa0hbUm3B0/s1600/photo.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO67Q2nAc6Xny4aiZOCEDUxgZBmfsxG1lJN_FeR5J0ngAnIprp73dgLXygCfSl_rqphm81onKVCAEF9qFj0P6U-sCVPK4O_YUPQ7FdR9rVbWFIyHFNctp16h8vi7pQ_-6zeLa0hbUm3B0/s320/photo.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;Of course I still have a bit more work to do and adjustments but these two platforms are going to get more than just puppeting software.&amp;nbsp; These will get brains, first small micro controller level programming and later more complex arm based slaving..</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/4161303210846524717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/4161303210846524717' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4161303210846524717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4161303210846524717'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/02/this-weeks-rebuilds-programming-to.html' title='This weeks rebuilds, programming to follow'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIOqzrqvdvPv1i_-oyusoNNNtyPrTmKjf6vzt0_DA8ST8AOVd19BVU6xTBM7lSNviBFqwsXZKG5ZYUeOzt6FqdrUXZpUpFNvTPgmuvEqHMW-k8yy-AcySga2bT59DTna4_btD57Uo05M4/s72-c/photo%25282%2529.JPG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-7046062456545997334</id><published>2011-02-06T09:24:00.000-08:00</published><updated>2011-02-06T11:47:46.954-08:00</updated><title type='text'>Initial attempt at self motivating,</title><content type='html'>Still a fair ways to go, need to flesh out a mapping / location tracking system and extend the weighted random behavior section.&amp;nbsp; However here is a basic moving / rule driven frame work intended for my linksprite base, Sharp IR, Arduino Nano 3.0 and Motor controller. It still needs to be woke up by serial, just send it any message and the routine will start.&lt;br /&gt;
&lt;br /&gt;
(Youtube like coming soon.)&lt;br /&gt;
&lt;br /&gt;
There is alot of unused / commented out bits in here but soon I will turn it all on.  If you have some suggestions please feel free to comment.  As far as I know this is one of the few public postings of arduino code with a set of behaviors and intent on mapping an area.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;int area[100][100];
int x=0;
int y=0;
long randNumber;
int bias1=50;
int bias2=50;
int bias3=25;
int bias4=30;
int bias5=25;
int dur=2000;
int pwr=255;
float inches;
int light;

int v = 0;
int lightPin = 0;  
int proxsens = 1; 
const int motorAPin1 = 3;   // AIN1
const int motorAPin2 = 4;   // AIN2
const int motorBPin1 = 6;  // BIN1
const int motorBPin2 = 7;  // BIN
const int PWMA = 2;
const int PWMB = 8;
 
void setup(){
  Serial.println(&quot;setup&quot;);
  x=0;
  y=0;
  //initmap();
  randomSeed(analogRead(6));
  Serial.begin(9600);
  establishContact();
  // set outputs:
  pinMode(motorAPin1, OUTPUT);
  pinMode(motorAPin2, OUTPUT);
  pinMode(motorBPin1, OUTPUT);
  pinMode(motorBPin2, OUTPUT);
  pinMode(PWMA, OUTPUT);
  pinMode(PWMB, OUTPUT);
}

//void initmap(){
//for ( int x=0 ; x &lt; 99 ; x++ ){
//  for ( int y=0 ; y &lt; 99 ; y++ ){
//   area[x][y]=1;
//  } 
// }
//}
//void printmap(){
//for ( int x=0 ; x &lt; 99 ; x++ ){
//  for ( int y=0 ; y &lt; 99 ; y++ ){
//   Serial.print(area[x][y]);
//  } 
// }
//}

//Setting up functions for testing
void stp() {  
  Serial.println(&quot;Stopping&quot;);
  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, LOW);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, LOW);
  analogWrite(PWMA, 0);
  analogWrite(PWMB, 0);
  delay(500);
}

void fwd(int p, int d) {
  Serial.print(&quot;Forward,&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(p);
  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, HIGH);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, HIGH);
  analogWrite(PWMA, p);
  analogWrite(PWMB, p);
  delay(d);
  stp();
}

void rev(int p, int d){
  Serial.print(&quot;Reverse&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(p);
  digitalWrite(motorAPin1, HIGH);
  digitalWrite(motorAPin2, LOW);
  digitalWrite(motorBPin1, HIGH);
  digitalWrite(motorBPin2, LOW);
  analogWrite(PWMA, p);
  analogWrite(PWMB, p);
  delay(d);
  stp();
}

void rgt(int p, int d){
    Serial.print(&quot;Right,&quot;);
    Serial.print(d);
    Serial.print(&quot;,&quot;);
    Serial.println(p);
    digitalWrite(motorAPin1, LOW);
    digitalWrite(motorAPin2, HIGH);
    digitalWrite(motorBPin1, HIGH);
    digitalWrite(motorBPin2, LOW);
    analogWrite(PWMA, p);
    analogWrite(PWMB, p);
    delay(d);
    stp();
}

void lft(int p, int d){
    Serial.print(&quot;Left,&quot;);
    Serial.print(d);
    Serial.print(&quot;,&quot;);
    Serial.println(p);
    digitalWrite(motorAPin1, HIGH);
    digitalWrite(motorAPin2, LOW);
    digitalWrite(motorBPin1, LOW);
    digitalWrite(motorBPin2, HIGH);
    analogWrite(PWMA, p);
    analogWrite(PWMB, p);
    delay(d);
    stp();
}

void loop(){
  Serial.print(&quot;Main Loop&quot;);
  float inches = 0.393700787*(9462/(analogRead(proxsens)-16.92));
  //Some behavior
  if ( inches &lt; 15 &amp; inches &gt; 0){
    Serial.print(&quot;Yikes something is at&quot;);
    Serial.println(inches);
    rev(150,500);
  }
 
  Serial.println(&quot;Going auto&quot;);
    randNumber = random(0, 150);
    Serial.println(randNumber);
    light=analogRead(lightPin);
    if ((randNumber-bias1) &lt;= 10 &amp;&amp; (randNumber-bias1) &gt; 0){
      Serial.println(&quot;action 1&quot;);
      Serial.println((randNumber-bias1));
      fwd(pwr,dur);
      fwd(pwr,dur);
      fwd(pwr,dur);
    }else if ((randNumber-bias2) &lt;= 20 &amp;&amp; (randNumber-bias1) &gt; 10){
      Serial.println(&quot;action 2&quot;); 
      Serial.println((randNumber-bias2));      
      rgt(pwr,dur);
    }else if ((randNumber-bias3) &lt;= 30 &amp;&amp; (randNumber-bias1) &gt; 20){
      Serial.println(&quot;action 3&quot;);
      Serial.println((randNumber-bias3));      
      rev(pwr,dur);
    }else if ((randNumber-bias4) &lt;= 40 &amp;&amp; (randNumber-bias1) &gt; 30){
      Serial.println(&quot;action 4&quot;);            
      Serial.println((randNumber-bias4));      
      lft(pwr,dur);
    }else if ((randNumber-bias5) &lt;= 50 &amp;&amp; (randNumber-bias1) &gt; 40){ 
      Serial.println(&quot;action 5&quot;);           
      Serial.println((randNumber-bias5));      
      fwd(pwr,dur);
    }else {
      Serial.print(&quot;Status:&quot;);
      Serial.print(x);
      Serial.print(&quot;,&quot;);
      Serial.print(y);
      Serial.print(&quot;,&quot;);
      Serial.print(light);
      Serial.print(&quot;,&quot;);
      Serial.println(inches);
      //printmap();
    }
 
   Serial.println(&quot;Resting&quot;);
   delay(500);
}
  
 

 
void establishContact() {
  while (Serial.available() &lt;= 0) {
    Serial.println(&quot;helo&quot;);   // send an initial string
    delay(300);
  }
}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/7046062456545997334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/7046062456545997334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/7046062456545997334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/7046062456545997334'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/02/initial-attempt-at-self-motivating.html' title='Initial attempt at self motivating,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-7881726428189059849</id><published>2011-01-30T16:46:00.000-08:00</published><updated>2011-02-06T11:50:04.045-08:00</updated><title type='text'>Got some new toys from CuteDigi!</title><content type='html'>Ok first let me say the Arduino Nano rocks, tiny breadboard or perfboard friendly and worked with my normal arduino programming and programmer in moments.&amp;nbsp; Added one of my breadboards and my Sparkfun Motor Driver 1A Dual TB6612FNG to the LinkSprite Robot Platform and in minutes I had a robot base. Sharp IR Distance Sensor GP2Y0A02YK (8-60 inches) was also in my order.. &lt;br /&gt;
So I skimmed through the &lt;a href=&quot;http://www.cutedigi.com/pub/Arduino/Arduino_Nano3_0.pdf&quot;&gt;PDF&lt;/a&gt; and cut / trimmed some jumperwire.. &lt;br /&gt;
And after a bit of adjusting came up with this.. .&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-pGmjkXu93E3qdMvaQ6YtgT0v04pY1HLlh-Sdy1CfkCTbUbqXppIB-8XdHrLTq5xjefgjpyqTN3eml9Fnt6KweZSDhlehpgMA5EP-XM8TgduN2ADUoNAHZCCuzKzyKWhkSn4FLLYyfsE/s1600/newrobot.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-pGmjkXu93E3qdMvaQ6YtgT0v04pY1HLlh-Sdy1CfkCTbUbqXppIB-8XdHrLTq5xjefgjpyqTN3eml9Fnt6KweZSDhlehpgMA5EP-XM8TgduN2ADUoNAHZCCuzKzyKWhkSn4FLLYyfsE/s320/newrobot.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
A few gotchas, the IR range finder didn&#39;t come with any hookup cable and needs one.&lt;br /&gt;
The sony sensor doesn&#39;t have much written up on it but I&#39;ll work on it.. &lt;br /&gt;
The Motor mounts could use a little lock-tight or epoxy to keep them from shifting.&lt;br /&gt;
But heck for about 100 bucks you get more robot than a BeO Bot kit for sure..!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I dug up my old test code and modified it a bit...&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;#define VOLTS_PER_UNIT    .0049F        // (.0049 for 10 bit A-D)


float inches;

int v = 0;
int lightPin = 0;  
int proxsens = 1; 
const int motorAPin1 = 3;   // AIN1
const int motorAPin2 = 4;   // AIN2
const int motorBPin1 = 6;  // BIN1
const int motorBPin2 = 7;  // BIN
const int PWMA = 2;
const int PWMB = 8;
 
void setup() {
  Serial.begin(9600);
  establishContact();
  // set outputs:
  pinMode(motorAPin1, OUTPUT);
  pinMode(motorAPin2, OUTPUT);
  pinMode(motorBPin1, OUTPUT);
  pinMode(motorBPin2, OUTPUT);
  pinMode(PWMA, OUTPUT);
  pinMode(PWMB, OUTPUT);
}
//Setting up functions for testing
void stp() {  
  Serial.println(&quot;Stopping&quot;);
  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, LOW);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, LOW);
  analogWrite(PWMA, 0);
  analogWrite(PWMB, 0);
  delay(500);
}

void fwd(int p, int d) {
  Serial.print(&quot;Forward,&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(p);
  digitalWrite(motorAPin1, LOW);
  digitalWrite(motorAPin2, HIGH);
  digitalWrite(motorBPin1, LOW);
  digitalWrite(motorBPin2, HIGH);
  analogWrite(PWMA, p);
  analogWrite(PWMB, p);
  delay(d);
  stp();
}

void rev(int p, int d){
  Serial.print(&quot;Reverse&quot;);
  Serial.print(d);
  Serial.print(&quot;,&quot;);
  Serial.println(p);
  digitalWrite(motorAPin1, HIGH);
  digitalWrite(motorAPin2, LOW);
  digitalWrite(motorBPin1, HIGH);
  digitalWrite(motorBPin2, LOW);
  analogWrite(PWMA, p);
  analogWrite(PWMB, p);
  delay(d);
  stp();
}

void rgt(int p, int d){
    Serial.print(&quot;Right,&quot;);
    Serial.print(d);
    Serial.print(&quot;,&quot;);
    Serial.println(p);
    digitalWrite(motorAPin1, LOW);
    digitalWrite(motorAPin2, HIGH);
    digitalWrite(motorBPin1, HIGH);
    digitalWrite(motorBPin2, LOW);
    analogWrite(PWMA, p);
    analogWrite(PWMB, p);
    delay(d);
    stp();
}

void lft(int p, int d){
    Serial.print(&quot;Left,&quot;);
    Serial.print(d);
    Serial.print(&quot;,&quot;);
    Serial.println(p);
    digitalWrite(motorAPin1, HIGH);
    digitalWrite(motorAPin2, LOW);
    digitalWrite(motorBPin1, LOW);
    digitalWrite(motorBPin2, HIGH);
    analogWrite(PWMA, p);
    analogWrite(PWMB, p);
    delay(d);
    stp();
}

void loop()
{
float inches = 0.393700787*(9462/(analogRead(proxsens)-16.92));
//Some behavior
if ( inches &lt; 15 &amp; inches &gt; 0){
  Serial.print(&quot;Yikes something is at&quot;);
  Serial.println(inches);
  rev(150,500);
}
 if ( Serial.available()) {
    char ch = Serial.read();
    Serial.println(ch);
    Serial.print(&quot;Rangefinder in:&quot;);
    Serial.println(inches);
    switch(ch) {
      case &#39;0&#39;...&#39;9&#39;:
        Serial.println(&quot;Got case Power&quot;);
        v = 0 + ch - &#39;0&#39;;
        v = v*29;
        Serial.println(v, DEC);
        break;
      case &#39;b&#39;:
        rev(v,1000);
        break;
      case &#39;f&#39;:
      if ( inches &lt; 15 ){
        Serial.print(&quot;Object too close, &quot;);
        Serial.print(DEC, inches);
        Serial.println(&quot; inches away&quot;);
        break;
      }else {
        Serial.print(&quot;Proximity reading, &quot;);
        Serial.print(DEC, inches);
        Serial.println(&quot; inches&quot;);
        fwd(v,1000);
        break;
      }
      case &#39;r&#39;:
        rgt(v,1000);
        break;
      case &#39;l&#39;:
        lft(v,1000);
        break;
      case &#39;s&#39;:
        stp();
        break;
    }
 }
}
 
void establishContact() {
  while (Serial.available() &lt;= 0) {
    Serial.println(&quot;helo&quot;);   // send an initial string
    delay(300);
  }
}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/7881726428189059849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/7881726428189059849' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/7881726428189059849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/7881726428189059849'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/01/got-some-new-toys-from-cutedigi.html' title='Got some new toys from CuteDigi!'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-pGmjkXu93E3qdMvaQ6YtgT0v04pY1HLlh-Sdy1CfkCTbUbqXppIB-8XdHrLTq5xjefgjpyqTN3eml9Fnt6KweZSDhlehpgMA5EP-XM8TgduN2ADUoNAHZCCuzKzyKWhkSn4FLLYyfsE/s72-c/newrobot.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-1035398743672046793</id><published>2011-01-25T06:13:00.000-08:00</published><updated>2011-02-06T11:52:02.771-08:00</updated><title type='text'>Another arduino biped example, this one with working source code,</title><content type='html'>A brilliant biped example! From a clever guy on &lt;a href=&quot;http://lars.roland.bz/biped-arduino-robot/code/&quot;&gt;Disruptive Messaging&lt;/a&gt;&lt;br /&gt;
My hats off to this DIY&#39;er,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;&lt;img height=&quot;320&quot; src=&quot;http://lars.roland.bz/images/robot600.jpg&quot; width=&quot;230&quot; /&gt;&lt;/center&gt;&lt;br /&gt;
I&#39;ve actually been thinking about positions modified by math as a pattern rather than positions as a pattern.  I&#39;ll take a look at this source and see how hard it is to reduce it to 6 servos and still walk.. &lt;br /&gt;
&lt;br /&gt;
Here is his aduino source! And again the link to his blog post&lt;a href=&quot;http://lars.roland.bz/biped-arduino-robot/code/&quot;&gt;Disruptive Messaging&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;#include &lt;servo.h&gt;

Servo RHip1;  Servo RHip2;
Servo RThigh;
Servo RKnee;
Servo RAnkle1;
Servo RAnkle2;

Servo LHip1;  Servo LHip2;
Servo LThigh;
Servo LKnee;
Servo LAnkle1;
Servo LAnkle2;

// Lean back
//LThigh.write(LThigh.read()-5);
//  RThigh.write(RThigh.read()+5);

int RHip1Center = 90;  int RHip2Center = 90;
int RThighCenter = 75;
int RKneeCenter = 110;
int RAnkle1Center = 100;
int RAnkle2Center = 60;

int LHip1Center = 100;  int LHip2Center = 40;
int LThighCenter = 50;
int LKneeCenter = 70;
int LAnkle1Center = 90;
int LAnkle2Center = 70;

int walking = 0;

int d = 100;

void setup()
{

Serial.begin(9600);
RHip1.attach(13);   RHip2.attach(12);   RThigh.attach(11);
RKnee.attach(10);   RAnkle1.attach(9);   RAnkle2.attach(8);
LHip1.attach(2);   LHip2.attach(3);   LThigh.attach(4);
LKnee.attach(5);   LAnkle1.attach(6);   LAnkle2.attach(7);
}

void loop()
{

//stand();
//crouch();
//delay(15000);  //  if (walking == 0) {
//StandRightForward();
//delay(15000);       //StandLeftForward();
//delay(15000);       //stand();
//      delay(5000);  //  }

//swayright();
//swayleft();
StandRightForward();
//delay(5000);   stepleft();
//delay(5000);  //  walk();
}

void stepleft()
{
StandRightForward();
LeanBack();
LeanRight();
LiftRightHip();
SpreadLegs();
// Low batt, spread legs more
SpreadLegs();
LeanRight();
LeanRight();
LeanRight();

LiftLeftFoot();
LiftLeftHip();
LiftLeftHip();
SpreadLegs();

LiftLeftFoot();
//LeanBack();
//LeanBack();

LeftLegForward();
LeftLegForward();
LeftLegForward();

// Does this cause more speed and cause the inbalance?
StretchRightKnee();
DownLeftFoot();
LeanBack();
LeftToeUp();
DownLeftFoot();

LeftToeUp();
LeftToeUp();
RightToeUp();

LeanLeft();
LeftToeUp();
RightToeUp();
LeanLeft();
LiftRightHip();
LiftRightHip();
DownLeftFoot();
LeanBack();

StandLeftForward();
//LeanBack();
//LeanBack();

LeanLeft();
LiftLeftHip();
//Low battery, turn on this:
//SpreadLegs();
SpreadLegs();
LeanLeft();
LeanLeft();

LiftRightFoot();
LiftRightHip();
LiftRightHip();
SpreadLegs();

LiftRightFoot();
LeanBack();
LeanBack();

RightLegForward();
RightLegForward();
RightLegForward();
RightLegForward();

StretchLeftKnee();

DownRightFoot();
LeanBack();

RightToeUp();
DownRightFoot();

RightToeUp();
RightToeUp();
LeftToeUp();
LeanRight();
LeftToeUp();
RightToeUp();
LeanRight();
LiftLeftHip();
LiftLeftHip();
DownRightFoot();
LeanBack();
StandRightForward();

}

/*
void swayright()
{

LeanRight();
LiftRightHip();
SpreadLegs();
LeanRight();
//LeanRight();
LeanRight();
LeanRight();

delay(5000);
LeanLeft();
LeanLeft();
LiftLeftHip();

}

void swayleft()
{

LeanLeft();
LiftLeftHip();
SpreadLegs();
LeanLeft();
//LeanLeft();
LeanLeft();
LeanLeft();

delay(5000);
LeanRight();
LeanRight();
LiftRightHip();   stand();

}
*/

void stand()
{
Serial.println(“STAND”);
RHip1.write(RHip1Center);     RHip2.write(RHip2Center);     RThigh.write(RThighCenter);
RKnee.write(RKneeCenter);     RAnkle1.write(RAnkle1Center);     RAnkle2.write(RAnkle2Center);
LHip1.write(LHip1Center);     LHip2.write(LHip2Center);     LThigh.write(LThighCenter);
LKnee.write(LKneeCenter);     LAnkle1.write(LAnkle1Center);     LAnkle2.write(LAnkle2Center);
delay(d);  }

void crouch()
{

Serial.println(“crouch”);
RThigh.write(RThigh.read()-10);
RKnee.write(RKnee.read()-20);   RAnkle1.write(RAnkle1.read()-10);
LThigh.write(LThigh.read()+10);
LKnee.write(LKnee.read()+20);   LAnkle1.write(LAnkle1.read()+10);
delay(d);
}

void StandRightForward()
{
Serial.println(“StandRightForward”);
RHip1.write(RHip1Center);     RHip2.write(RHip2Center);     RThigh.write(RThighCenter);
RKnee.write(RKneeCenter);     RAnkle1.write(RAnkle1Center);     RAnkle2.write(RAnkle2Center);
LHip1.write(LHip1Center);     LHip2.write(LHip2Center);     LThigh.write(LThighCenter-20);
LKnee.write(LKneeCenter);     LAnkle1.write(LAnkle1Center+20);     LAnkle2.write(LAnkle2Center);
delay(d);  }

void StandLeftForward()
{
Serial.println(“StandLeftForward”);
RHip1.write(RHip1Center);     RHip2.write(RHip2Center);     RThigh.write(RThighCenter+20);
RKnee.write(RKneeCenter);     RAnkle1.write(RAnkle1Center-20);     RAnkle2.write(RAnkle2Center);
LHip1.write(LHip1Center);     LHip2.write(LHip2Center);     LThigh.write(LThighCenter);
LKnee.write(LKneeCenter);     LAnkle1.write(LAnkle1Center);     LAnkle2.write(LAnkle2Center);
delay(d);  }

void ResetHip()
{
Serial.println(“ResetHip”);
LHip2.write(LHip2.read()+5);   RHip2.write(RHip2.read()+5);   delay(d);                       }

void LiftLeftHip()
{
Serial.println(“LiftLeftHip”);
LHip2.write(RHip1Center);   LHip2.write(RHip2Center);   LHip2.write(LHip1Center);   LHip2.write(LHip2Center);   delay(d);                       }

void LiftRightHip()
{
Serial.println(“LiftRightHip”);
LHip2.write(LHip2.read()-5);   RHip2.write(RHip2.read()-5);   delay(d);                       }

void SpreadLegs()
{
Serial.println(“SpreadLegs”);
LHip2.write(LHip2.read()-5);   RHip2.write(RHip2.read()+5);   delay(d);                       }

void CollectLegs()
{
Serial.println(“CollectLegs”);
LHip2.write(LHip2.read()+5);   RHip2.write(RHip2.read()-5);   delay(d);                       }

void LeanLeft() {
Serial.println(“LeanLeft”);
RAnkle2.write(RAnkle2.read()-5);
LAnkle2.write(LAnkle2.read()-5);
delay(d);                       }

void LeanRight() {
Serial.println(“LeanRight”);
RAnkle2.write(RAnkle2.read()+5);
LAnkle2.write(LAnkle2.read()+5);
delay(d);                       }

void LeftLegForward() {
Serial.println(“LeftFootForward”);
LThigh.write(LThigh.read()+10);
LKnee.write(LKnee.read()-10);   LAnkle1.write(LAnkle1.read()-10);
delay(d);                       }

void LeftFootForward() {
Serial.println(“LeftFootForward”);
//LThigh.write(LThigh.read()+10);
LKnee.write(LKnee.read()-10);   LAnkle1.write(LAnkle1.read()-5);
delay(d);                       }

void LeanBack()
{
Serial.println(“LeanBack”);
LThigh.write(LThigh.read()-5);
RThigh.write(RThigh.read()+5);
delay(d);  }

void LeanForward()
{
Serial.println(“LeanBack”);
LThigh.write(LThigh.read()+10);
RThigh.write(RThigh.read()-10);
delay(d);  }

void LeftThighBackward() {
Serial.println(“LeftFootBack”);
LThigh.write(LThigh.read()-10);
delay(d);                       }

void LeftThighForward() {
Serial.println(“LeftThighForward”);
LThigh.write(LThigh.read()+10);
delay(d);                       }

void StretchLeftKnee() {
Serial.println(“StretchLeftKnee”);
LKnee.write(LKnee.read()-5);   delay(d);                       }

void LiftLeftFoot() {
Serial.println(“LiftLeftFoot”);
LThigh.write(LThigh.read()+10);
LKnee.write(LKnee.read()+10);     LAnkle1.write(LAnkle1.read()-10);
delay(d);                       }

void DownLeftFoot() {
Serial.println(“DownLeftFoot”);
LThigh.write(LThigh.read()-10);
LKnee.write(LKnee.read()-5);     LAnkle1.write(LAnkle1.read()-5);
delay(d);                       }

void RightLegForward() {
Serial.println(“RightLegForward”);
RThigh.write(RThigh.read()-10);
RKnee.write(RKnee.read()+10);     RAnkle1.write(RAnkle1.read()+10);
delay(d);                       }

void RightFootForward() {
Serial.println(“RightFootForward”);
//RThigh.write(RThigh.read()-10);
RKnee.write(RKnee.read()+10);     RAnkle1.write(RAnkle1.read()+5);
delay(d);                       }

void RightThighBackward()
{
Serial.println(“RightFootForward”);
RThigh.write(RThigh.read()+10);   delay(d);    }

void RightThighForward()
{
Serial.println(“RightFootForward”);
RThigh.write(RThigh.read()-10);   delay(d);  }

void RightToeUp()
{
Serial.println(“RightAnkleForward”);
RAnkle1.write(RAnkle1.read()-5);
delay(d);                       }

void RightToeDown()
{
Serial.println(“RightAnkleBackward”);
RAnkle1.write(RAnkle1.read()+5);
delay(d);                       }

void ResetLeftAnkle()
{
Serial.println(“ResetLeftAnkle”);
LAnkle1.write(RAnkle1Center);
LAnkle1.write(RAnkle2Center);
delay(d);                       }

void ResetRightAnkle()
{
Serial.println(“ResetLeftAnkle”);
LAnkle1.write(RAnkle1Center);
LAnkle1.write(RAnkle2Center);
delay(d);                       }

void LeftToeUp()
{
Serial.println(“LeftAnkleForward”);
LAnkle1.write(LAnkle1.read()+5);
delay(d);                       }

void LeftToeDown()
{
Serial.println(“LeftAnkleBackward”);
LAnkle1.write(LAnkle1.read()-5);
delay(d);                       }

void StretchRightKnee() {
Serial.println(“StretchRightKnee”);
RKnee.write(RKnee.read()+5);   delay(d);                       }

void LiftRightFoot() {
Serial.println(“LiftRightFoot”);
RThigh.write(RThigh.read()-10);
RKnee.write(RKnee.read()-10);   RAnkle1.write(RAnkle1.read()+10);
delay(d);                       }

void DownRightFoot() {
Serial.println(“DownRightFoot”);
RThigh.write(RThigh.read()+10);
RKnee.write(RKnee.read()+5);   RAnkle1.write(RAnkle1.read()+5);
delay(d);                       }
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/1035398743672046793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/1035398743672046793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1035398743672046793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1035398743672046793'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/01/another-arduino-biped-example-this-one.html' title='Another arduino biped example, this one with working source code,'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-644482775693834189</id><published>2011-01-12T07:29:00.000-08:00</published><updated>2011-02-06T11:53:28.596-08:00</updated><title type='text'>New test command, Python Curses and pyserial for servo control</title><content type='html'>Ok, &lt;br /&gt;
First phase, find a better UI than reading things typed in and then pressing enter.  Find #1 Curses, issue number #1 curses is huge and I don&#39;t want to learn it all.  So after reviewing a few different examples, tinkering a bit, reading mailing lists (why the main python page doesn&#39;t explain some of this I don&#39;t know.).. &lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/python
import curses, time, sys
def main(stdscr):
 x=0
 while x != ord(&#39;q&#39;):
    stdscr.clear()
    stdscr.border(1)
    stdscr.addstr(1, 2, &quot;Hello World! q) to quit&quot;) # or what you want
    stdscr.refresh()
    x = stdscr.getch()

curses.wrapper(main)
exit()
&lt;/pre&gt;Was that so hard?? &lt;br /&gt;
&lt;br /&gt;
But here ya go.. curses servo control!  Note adaptable but meant for my Arduino Servo controller setup.  That being said this should work well with Scott Mini, Pololu and several others.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHJluwiupUkNhpc9pXFDiKG-6VJuajGygWD-QAnrELiyEHQUlE8bB4dU8oEI-3mXu2HsYMwkGHpcA1rT4t5vYJcmbHHZpFT0PGWKOXEwCIgxSLpdn9xiTPgCaQ7BRSFL_TFfuAI-A3Nb0/s1600/pycursesv1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;213&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHJluwiupUkNhpc9pXFDiKG-6VJuajGygWD-QAnrELiyEHQUlE8bB4dU8oEI-3mXu2HsYMwkGHpcA1rT4t5vYJcmbHHZpFT0PGWKOXEwCIgxSLpdn9xiTPgCaQ7BRSFL_TFfuAI-A3Nb0/s320/pycursesv1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Ok,&lt;br /&gt;
First version done, phew gota say I avoided curses for a reason. However I think this is both simple and fairly complex.  Still looking to do a bit more, last x commands sent window (possibly with edit / resend) a connect / disconnect function with error handling.  However, this works, exits gracefully and is happy in my ARM Hawkboard&#39;s OS.. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/env python
import time, sys, serial, curses
from os import system
log=&quot;./servopos.log&quot;
logfile=open(log,&quot;w&quot;)

#set up the serial port for action (0==COM1==ttyS0)
if &#39;comport&#39; not in dir():
 comport=&quot;/dev/ttyUSB1&quot;

if &#39;baudrate&#39; not in dir():
 baudrate=&quot;9600&quot;

packet=0
servo=list()
max=5
first=0

while first &lt;= max:
 servo.append([first,&#39;90&#39;])
 first=first+1

def sercon(baudrate,comport):
    global ser
    ser=serial.Serial(comport)
    ser.baudrate=baudrate

def setpos(n,angle):
    packet=chr(255)+chr(n)+chr(angle)
    ser.write(packet)
    cmd=str(n)+&quot;,&quot;+str(angle)+&quot;\n&quot;
    logfile.write(cmd)




###Begin Main###
def main(stdscr):
        def get_param(prompt_string):
         curses.echo()
         stdscr.clear()
         stdscr.border(1)
         stdscr.addstr(2, 2, prompt_string)
         stdscr.refresh()
         input = stdscr.getstr(10, 10, 60)
         return input

        global log,logfile,baudrate,comport
        x = 0
        sercon(baudrate,comport)
        while x != ord(&#39;4&#39;):
            stdscr.clear()
            stdscr.border(0)
            stdscr.addstr(1, 1, &#39;Curses Servo control by Auzie Morgan&#39;)
            stdscr.addstr(2, 2, &#39;(1)-change Servo control com:&#39;+str(comport)+&#39; baud:&#39;+str(baudrate))
            stdscr.addstr(3, 2, &#39;(2)-change logfile:&#39;+str(logfile)+&#39; &#39;)
            stdscr.addstr(4, 4, &#39;Servo 0 =(a+/z-) 5 Current:&#39;+str(servo[0][1]))
            stdscr.addstr(5, 4, &#39;Servo 1 =(s+/x-) 5 Current:&#39;+str(servo[1][1]))
            stdscr.addstr(6, 4, &#39;Servo 2 =(d+/c-) 5 Current:&#39;+str(servo[2][1]))
            stdscr.addstr(7, 4, &#39;Servo 3 =(f+/v-) 5 Current:&#39;+str(servo[3][1]))
            stdscr.addstr(8, 4, &#39;Servo 4 =(g+/b-) 5 Current:&#39;+str(servo[4][1]))
            stdscr.addstr(9, 4, &#39;Servo 5 =(h+/n-) 5 Current:&#39;+str(servo[5][1]))
            stdscr.addstr(10, 4, &quot;4 - Exit&quot;)
            stdscr.refresh()
            x = stdscr.getch()

            if x == ord(&#39;a&#39;):
              servo[0][1]=int(servo[0][1])+5
              setpos(servo[0][0],servo[0][1])
            if x == ord(&#39;z&#39;):
              servo[0][1]=int(servo[0][1])-5
              setpos(servo[0][0],servo[0][1])
            if x == ord(&#39;s&#39;):
              servo[1][1]=int(servo[1][1])+5
              setpos(servo[1][0],servo[1][1])
            if x == ord(&#39;x&#39;):
              servo[1][1]=int(servo[1][1])-5
              setpos(servo[1][0],servo[1][1])
            if x == ord(&#39;d&#39;):
              servo[2][1]=int(servo[2][1])+5
              setpos(servo[2][0],servo[2][1])
            if x == ord(&#39;c&#39;):
              servo[2][1]=int(servo[2][1])-5
              setpos(servo[2][0],servo[2][1])
            if x == ord(&#39;f&#39;):
              servo[3][1]=int(servo[3][1])+5
              setpos(servo[3][0],servo[3][1])
            if x == ord(&#39;v&#39;):
              servo[3][1]=int(servo[3][1])-5
              setpos(servo[3][0],servo[3][1])
            if x == ord(&#39;g&#39;):
              servo[4][1]=int(servo[4][1])+5
              setpos(servo[4][0],servo[4][1])
            if x == ord(&#39;b&#39;):
              servo[4][1]=int(servo[4][1])-5
              setpos(servo[4][0],servo[4][1])
            if x == ord(&#39;h&#39;):
              servo[5][1]=int(servo[5][1])+5
              setpos(servo[5][0],servo[5][1])
            if x == ord(&#39;n&#39;):
              servo[5][1]=int(servo[5][1])-5
              setpos(servo[5][0],servo[5][1])
            if x == ord(&#39;1&#39;):
              ser.close()
              baudrate=get_param(&quot;Type new baudrate:&quot;)
              comport=get_param(&quot;Type new comport:&quot;)
              sercon(baudrate,comport)
            if x == ord(&#39;2&#39;):
              logfile.close()
              log=get_param(&quot;Type new logfile name:&quot;)
              logfile=open(log,&quot;w&quot;)

            stdscr.clear()
            curses.echo()
            curses.endwin()
            logfile.close()
###End Main###
curses.wrapper(main)
exit()

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/644482775693834189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/644482775693834189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/644482775693834189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/644482775693834189'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2011/01/new-test-command-python-curses-and.html' title='New test command, Python Curses and pyserial for servo control'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHJluwiupUkNhpc9pXFDiKG-6VJuajGygWD-QAnrELiyEHQUlE8bB4dU8oEI-3mXu2HsYMwkGHpcA1rT4t5vYJcmbHHZpFT0PGWKOXEwCIgxSLpdn9xiTPgCaQ7BRSFL_TFfuAI-A3Nb0/s72-c/pycursesv1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-4186661687149735007</id><published>2010-12-30T09:37:00.000-08:00</published><updated>2010-12-30T10:36:55.124-08:00</updated><title type='text'>Getting restarted on the BiPed</title><content type='html'>Ok, &lt;br /&gt;
I&#39;ll revise this a bit more before I&#39;m done including pictures and video links.  Here is what I&#39;m working on / with.  &lt;a href=&quot;http://ottobelden.blogspot.com/search/label/Robotics&quot;&gt;My good buddy Otto&lt;/a&gt; got back to me with some clean-up on the Biped frame / feet.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXE9zmxotgrPutySM6BIfkya3sgr4vdxZoul6i783KOvotrhYx_-ulFKTUWlM3hv4looKF1B2Kja4beEdaK_GEwF5KhYIKii6lpQ0mUMNyI5fN8QSI4816VKBEZShS-2jXiN6XLmak2jg/s320/Robot+Legs.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXE9zmxotgrPutySM6BIfkya3sgr4vdxZoul6i783KOvotrhYx_-ulFKTUWlM3hv4looKF1B2Kja4beEdaK_GEwF5KhYIKii6lpQ0mUMNyI5fN8QSI4816VKBEZShS-2jXiN6XLmak2jg/s320/Robot+Legs.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Which is much better than before I handed it over to him :)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRsqYMhgkKK7_uSgSPlSW_lxKeYU415mnnbOu4iIoW88lNfUmb3f7-cADvMSOTSgDUoSWD8HR2VI54WA7FmtQogcZjfMd7v6iTzawj6ggVbEwW_H5tDY2oNO-10lbqOsY0br83RN1xf7W6/s320/Biped+Robot.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRsqYMhgkKK7_uSgSPlSW_lxKeYU415mnnbOu4iIoW88lNfUmb3f7-cADvMSOTSgDUoSWD8HR2VI54WA7FmtQogcZjfMd7v6iTzawj6ggVbEwW_H5tDY2oNO-10lbqOsY0br83RN1xf7W6/s320/Biped+Robot.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;I&#39;ve decided this time to run all testing etc using the Hawkboard + usb hub -&amp;gt; robot.  This rig will be controlled over tcp/ip and serial links.  The Hawkboard set-up is going to be basically the same as the &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBYQFjAA&amp;amp;url=http%3A%2F%2Felinux.org%2FHawkboard%2FBeginnersGuide&amp;amp;rct=j&amp;amp;q=Hawkboard%20Beginners%20guide&amp;amp;ei=HNEcTYDcCYbmsQOg_uHdAg&amp;amp;usg=AFQjCNHhz0R_j3V0fIllGMG4qeDvTGe5_Q&amp;amp;sig2=VVAIq6tv9gd0ceZOXNod8Q&amp;amp;cad=rja&quot;&gt;Beginners Guide&lt;/a&gt;.  On the HawkBoard&#39;s image (on an sd card right now) I have added ncurses, kernel source, python, opencv, sphinxs and speech.  Still missing is a good way to do audio capture(Who decided not to have Mic in on the Hawkbaord is a nut).  What I will be doing next is a testing rig (aka guide wires to prevent falling) as well as breadboarding the servo hookups.&lt;br /&gt;
&lt;br /&gt;
Hawkboard runs a usb hub, ibmcam, two serial to usb converters and is controlled via Ethernet and serial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stay tuned!</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/4186661687149735007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/4186661687149735007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4186661687149735007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/4186661687149735007'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/12/getting-restarted-on-biped.html' title='Getting restarted on the BiPed'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXE9zmxotgrPutySM6BIfkya3sgr4vdxZoul6i783KOvotrhYx_-ulFKTUWlM3hv4looKF1B2Kja4beEdaK_GEwF5KhYIKii6lpQ0mUMNyI5fN8QSI4816VKBEZShS-2jXiN6XLmak2jg/s72-c/Robot+Legs.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-5507727749331095151</id><published>2010-11-10T15:47:00.000-08:00</published><updated>2010-11-10T15:47:13.752-08:00</updated><title type='text'>My Challenge to America, stop falling behind the world in robotics.</title><content type='html'>Toyota Robot Violinist, not a Ford? Or MIT?&lt;br /&gt;
&lt;br /&gt;
 We need to expand the number of youths and adults experimenting in and producing robotics innovations and innovations in general.&lt;br /&gt;
&lt;br /&gt;
&lt;h1 id=&quot;watch-headline-title&quot;&gt;&lt;span class=&quot;&quot; dir=&quot;ltr&quot; id=&quot;eow-title&quot; title=&quot;Robot Violinist&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/h1&gt;&lt;br /&gt;
&lt;object height=&quot;385&quot; width=&quot;480&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/EzjkBwZtxp4?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/EzjkBwZtxp4?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
Part of my point in running this blog is to encourage folks to try building robots and electronics.  Who knows, you could be the next robot of the year.. So get out there, visit the vendors, leave me comments, questions.. but Innovate..</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/5507727749331095151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/5507727749331095151' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/5507727749331095151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/5507727749331095151'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/11/my-challenge-to-america-stop-falling.html' title='My Challenge to America, stop falling behind the world in robotics.'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-3296505312515721784</id><published>2010-09-28T12:16:00.000-07:00</published><updated>2010-09-28T12:18:40.876-07:00</updated><title type='text'>SparkFun has added Chumby parts and hacking board!</title><content type='html'>Personally I haven&#39;t done much with this yet, but I have seen it and read up on it.  Honestly it could lead to another explosion the likes of Arduino.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://wiki.ladyada.net/_media/chumbyhandbig.jpg?w=600&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;http://wiki.ladyada.net/_media/chumbyhandbig.jpg?w=600&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Low cost like the Hawkboard but with many advantages / disadvantages.. I&#39;ll write more later..&lt;br /&gt;
PS: They also have refurbished Chumby v1 boards ~40$ !!&amp;nbsp; For those who don&#39;t mind not having all the breakout pins seen above..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.sparkfun.com/commerce/product_info.php?products_id=10106&quot;&gt;Sparkfun Chumby&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.adafruit.com/index.php?main_page=index&amp;amp;cPath=46&quot;&gt;Adafruit Chumby stuff&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.adafruit.com/index.php?main_page=index&amp;amp;cPath=46&quot;&gt;Make Chumby stuff&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Get your Chumby on :)</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/3296505312515721784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/3296505312515721784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3296505312515721784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/3296505312515721784'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/09/sparkfun-has-added-chumby-parts-and.html' title='SparkFun has added Chumby parts and hacking board!'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-6584313761423117018</id><published>2010-09-09T07:00:00.000-07:00</published><updated>2011-02-06T12:01:53.006-08:00</updated><title type='text'>Hawk board notes, nfs booting..</title><content type='html'>Here are some fragments from a round of nfs booting the hawkboard.  I believe this was aimed at booting the Angstrom test images.&lt;br /&gt;
&lt;br /&gt;
Uboot commands on the Hawkboard,&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;set ipaddr 192.168.2.200
set serverip 192.168.2.35
tftp 0xc0900000 uImage

setenv bootargs &quot;mem=128M console=ttyS2,115200n8 root=/dev/nfs nfsroot=192.168.2.35:/nfsroot ip=dhcp&quot;

setenv bootcmd &#39;setenv bootargs $bootargsc0008000_nfs;tftp c0008000 uImage; bootm c0008000&#39;

setenv bootcmd &#39;setenv bootargs $bootargs;tftp c0700000 uImage; bootm c0700000&#39;


setenv bootargs &quot;console=ttyS2,115200n8 console=tty1 noinitrd root=/dev/sda1 rootwait rw init=/sbin/init&quot;mmcblk0

set ipaddr 192.168.2.200
set serverip 192.168.2.35
tftp 0xc0900000 uImage
setenv bootargs &quot;console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p1 rootwait rw init=/sbin/init ip=192.168.2.200&quot;
setenv bootcmd &#39;setenv bootargs $bootargs;tftp c0900000 uImage; bootm c0900000&#39;
&lt;/pre&gt;I&#39;ll add more / comment this out later..</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/6584313761423117018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/6584313761423117018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6584313761423117018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6584313761423117018'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/09/hawk-board-notes-nfs-booting.html' title='Hawk board notes, nfs booting..'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-8685699761507765587</id><published>2010-08-27T19:55:00.000-07:00</published><updated>2011-02-06T11:55:25.769-08:00</updated><title type='text'>Working wxpython example servo sliders code for arduino</title><content type='html'>Playing catchup reconstructing ubuilt-bots after it expired on godaddy onto blogger..&lt;br /&gt;
&lt;br /&gt;
Here is my Python wxpython slider code example.&amp;nbsp; This code talks to my arduino rc servo controller code example and makes testing various servo positions easier / more user friendly.&amp;nbsp; Its also a fine example of wxpython, simple and fairly easy to follow.&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/python
#^-- edit based on your system type / settings
#wxpython example, by Auzie Morgan
#This simple example sends the slider states to the SetPos serial communication object.
#This demonstrates PySerial, wxPython, lists, tuples, string encoding and more.
#It is intended to work with my Arduino code but can be adapted to many applications.
#Fragments that helped me put this together came from the Original Aurduino Servo code and from 
#forum postings in Pololu&#39;s user forums.
#
 
import serial  # import PySerial libraries
import wx
import time
usbport = &#39;/dev/ttyUSB2&#39;
#^--Edit based on your OS type and active serial port.
ser = serial.Serial(usbport, 9600, timeout=1)
#^--Edit based on speed options type of port etc.
print ser
 
&#39;&#39;&#39;
Still a bit quirky at least with my arduino code as it stands.  This code was derived from a Pololu forum post.  Modified to suit my interests and should work on linux or windows machines.
&#39;&#39;&#39;
 
 
 
def SetPos(SERVO,ANGLE):          
    &#39;&#39;&#39;Moves the specified servo to the supplied angle.
 
    Arguments:
        servo
          the servo number to command, an integer from 1-4
        angle
          the desired servo angle, an integer from 0 to 180
 
    (e.g.) &amp;gt;&amp;gt;&amp;gt; servo.move(2, 90)
           ... # &quot;move servo #2 to 90 degrees&quot;&#39;&#39;&#39;
    print &quot;SetPos called&quot;
    if (0 &amp;lt;= ANGLE &amp;lt;= 180):
        ser.write(chr(255))
        ser.write(chr(SERVO))
        ser.write(chr(ANGLE))
    print &quot;sending 255&quot;,SERVO,ANGLE 
 
 
 
class MyPanel(wx.Panel):
 
    def __init__(self, parent, id):
        self.lpos1 = 127
        self.lpos2 = 127
        self.lpos3 = 127
        self.lpos4 = 127
        self.lpos5 = 127
        self.lpos6 = 127
        self.lpos7 = 127
        self.lpos8 = 127  
        wx.Panel.__init__(self, parent, id)
        self.SetBackgroundColour(&quot;white&quot;)
        self.slider1 = wx.Slider(self, 0, 127, 0, 180, (100, 80), (50, 250),
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider2 = wx.Slider(self, 0, 127, 0, 180, (200, 80), (50, 250),                                                                              
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider3 = wx.Slider(self, 0, 127, 0, 180, (300, 80), (50, 250),                                                                              
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider4 = wx.Slider(self, 0, 127, 0, 180, (400, 80), (50, 250),
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider5 = wx.Slider(self, 0, 127, 0, 180, (500, 80), (50, 250),
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider6 = wx.Slider(self, 0, 127, 0, 180, (600, 80), (50, 250),                                                                              
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider7 = wx.Slider(self, 0, 127, 0, 180, (700, 80), (50, 250),                                                                              
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.slider8 = wx.Slider(self, 0, 127, 0, 180, (800, 80), (50, 250),
            wx.SL_VERTICAL | wx.SL_AUTOTICKS | wx.SL_LABELS)                                                                             
        self.Bind(wx.EVT_SLIDER, self.ServoUpdate)
 
 
    def ServoUpdate(self, event):  
        self.pos1 = self.slider1.GetValue()
        self.pos2 = self.slider2.GetValue()
        self.pos3 = self.slider3.GetValue()
        self.pos4 = self.slider4.GetValue()
        self.pos5 = self.slider5.GetValue()
        self.pos6 = self.slider6.GetValue()
        self.pos7 = self.slider7.GetValue()
        self.pos8 = self.slider8.GetValue()
 
        if (self.pos1 != self.lpos1):
            SetPos(0,self.pos1)
        if (self.pos2 != self.lpos2):
            SetPos(1,self.pos2)
        if (self.pos3 != self.lpos3):
            SetPos(2,self.pos3)
        if (self.pos4 != self.lpos4):
            SetPos(3,self.pos4) 
        if (self.pos5 != self.lpos5):
            SetPos(4,self.pos5)
        if (self.pos6 != self.lpos6):
            SetPos(5,self.pos6)
        if (self.pos7 != self.lpos7):
            SetPos(6,self.pos7)
        if (self.pos8 != self.lpos8):
            SetPos(7,self.pos8)
 
        self.lpos1 = self.pos8
        self.lpos2 = self.pos8
        self.lpos3 = self.pos8
        self.lpos4 = self.pos8
        self.lpos5 = self.pos8
        self.lpos6 = self.pos8
        self.lpos7 = self.pos8
        self.lpos8 = self.pos8        
 
app = wx.PySimpleApp()
 
frame = wx.Frame(None, -1, &quot;Simple Servo Controller&quot;, size = (950, 440))
 
MyPanel(frame,-1)
 
frame.Show(True)
 
app.MainLoop()
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/8685699761507765587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/8685699761507765587' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8685699761507765587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8685699761507765587'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/working-wxpython-example-servo-sliders.html' title='Working wxpython example servo sliders code for arduino'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-2705258600289184612</id><published>2010-08-27T12:09:00.000-07:00</published><updated>2011-02-06T11:56:51.263-08:00</updated><title type='text'>Arduino, Scott Mini Servo / motor test 2</title><content type='html'>At this stage there were two controllers, one for motors and one for servos.  The motor controller that drives the tank treads was Arduino based with the TB6612FNG Breakout board from Sparkfun.  The servos were ran via a Scott Mini. I actually drove the tank motor to death, either torque or a bad choice of lubricant lead to the Tamia gearbox fracturing.&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;344&quot; style=&quot;background-image: url(http://i1.ytimg.com/vi/LcfKuCkxv88/hqdefault.jpg);&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/LcfKuCkxv88?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/LcfKuCkxv88?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the Arduino test Code for the base,&lt;br /&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;

int pos = 0;

const int motorAPin1 = 8;   // AIN1
const int motorAPin2 = 7;   // AIN2
const int motorBPin1 = 12;  // BIN1
const int motorBPin2 = 13;  // BIN2
const int enablePin = 2;    // H-bridge enable pin
const int PWMA = 3;
const int PWMB = 5;

void setup() {
    Serial.begin(9600);
    establishContact();
    // set outputs:
    pinMode(motorAPin1, OUTPUT);
    pinMode(motorAPin2, OUTPUT);
    pinMode(motorBPin1, OUTPUT);
    pinMode(motorBPin2, OUTPUT);
    pinMode(enablePin, OUTPUT);
    pinMode(PWMA, OUTPUT);
    pinMode(PWMB, OUTPUT);
    // set enablePin high so that motor can turn on:
    digitalWrite(enablePin, HIGH);
    
}

void loop() {
    Serial.println(&quot;First Loop&quot;);
    digitalWrite(motorAPin1, LOW);
    digitalWrite(motorAPin2, HIGH);
    for(pos = 10; pos &lt; 270; pos += 5)  // goes from 0 degrees to 180 degrees 
    {                                  // in steps of 1 degree 
    Serial.print(&quot;PWMA&quot;);
    Serial.println(pos, DEC);

    analogWrite(PWMA, pos);              // tell servo to go to position in variable &#39;pos&#39; 
    delay(30000);                       // waits 15ms for the servo to reach the position 
     }
    pos = 0;
    delay(15000);
    Serial.println(&quot;Second Loop&quot;);
    digitalWrite(motorAPin1, HIGH);
    digitalWrite(motorAPin2, LOW);
    for(pos = 10; pos &lt; 270; pos += 5)  // goes from 0 degrees to 180 degrees 
    {                                  // in steps of 1 degree 

    Serial.print(&quot;PWMA&quot;);
    Serial.println(pos, DEC);
    analogWrite(PWMA, pos);              // tell servo to go to position in variable &#39;pos&#39; 
    delay(30000);                       // waits 15ms for the servo to reach the position 
     }
    pos = 0;

}

void establishContact() {
  while (Serial.available() &lt;= 0) {
    Serial.println(&quot;0,0,0&quot;);   // send an initial string
    delay(300);
  }
}
&lt;/pre&gt;

And here is the later ascii over serial control for the Arduino,
&lt;pre class=&quot;brush: python&quot;&gt;

int v = 0;

const int motorAPin1 = 8;   // AIN1
const int motorAPin2 = 7;   // AIN2
const int motorBPin1 = 12;  // BIN1
const int motorBPin2 = 13;  // BIN2
const int enablePin = 2;    // H-bridge enable pin
const int PWMA = 3;
const int PWMB = 5;

void setup() {
    Serial.begin(9600);
    establishContact();
    // set outputs:
    pinMode(motorAPin1, OUTPUT);
    pinMode(motorAPin2, OUTPUT);
    pinMode(motorBPin1, OUTPUT);
    pinMode(motorBPin2, OUTPUT);
    pinMode(enablePin, OUTPUT);
    pinMode(PWMA, OUTPUT);
    pinMode(PWMB, OUTPUT);
    // set enablePin high so that motor can turn on:
    digitalWrite(enablePin, HIGH);
    
}

void loop()
{
 if ( Serial.available()) {
    char ch = Serial.read();
    Serial.println(ch);
    switch(ch) {
      case &#39;0&#39;...&#39;9&#39;:
        Serial.println(&quot;Got case Power&quot;);
        v = 0 + ch - &#39;0&#39;;
        v = v*29;
        Serial.println(v, DEC);
        break;
      case &#39;f&#39;:
        Serial.println(&quot;Got case F&quot;);
        Serial.println(v, DEC);
        digitalWrite(enablePin, HIGH);
        digitalWrite(motorAPin1, HIGH);
        digitalWrite(motorAPin2, LOW);
        digitalWrite(motorBPin1, HIGH);
        digitalWrite(motorBPin2, LOW);
        analogWrite(PWMA, v);
        analogWrite(PWMB, v);

        break;
      case &#39;b&#39;:
        Serial.println(&quot;Got case B&quot;);
        Serial.println(v, DEC);
        digitalWrite(enablePin, HIGH);
        digitalWrite(motorAPin1, LOW);
        digitalWrite(motorAPin2, HIGH);
        digitalWrite(motorBPin1, LOW);
        digitalWrite(motorBPin2, HIGH);
        analogWrite(PWMA, v);
        analogWrite(PWMB, v);
        break;
      case &#39;l&#39;:
        Serial.println(&quot;Got case l&quot;);
        Serial.println(v, DEC);
        digitalWrite(enablePin, HIGH);
        digitalWrite(motorAPin1, LOW);
        digitalWrite(motorAPin2, HIGH);
        digitalWrite(motorBPin1, HIGH);
        digitalWrite(motorBPin2, LOW);
        analogWrite(PWMA, v);
        analogWrite(PWMB, v);

        break;
      case &#39;r&#39;:
        Serial.println(&quot;Got case r&quot;);
        Serial.println(v, DEC);
        digitalWrite(enablePin, HIGH);
        digitalWrite(motorAPin1, HIGH);
        digitalWrite(motorAPin2, LOW);
        digitalWrite(motorBPin1, LOW);
        digitalWrite(motorBPin2, HIGH);
        analogWrite(PWMA, v);
        analogWrite(PWMB, v);

        break;
      case &#39;s&#39;:
        Serial.println(&quot;Got case Stop&quot;);
        digitalWrite(motorAPin1, LOW);
        digitalWrite(motorAPin2, LOW);
        digitalWrite(motorBPin1, LOW);
        digitalWrite(motorBPin2, LOW);
        analogWrite(PWMA, v);
        analogWrite(PWMB, v);
        digitalWrite(enablePin, LOW);

        break;
    }
 }
}

void establishContact() {
  while (Serial.available() &lt;= 0) {
    Serial.println(&quot;helo&quot;);   // send an initial string
    delay(300);
  }
}


&lt;/pre&gt;

For talking to the servos, at least in the beginning I used this rather popular mutation of some scott mini perl script.  I call it Servo Control 2 because I cleaned up the original and extended it to handle all 8 channels of the Scott Mini.  Of course my wxpython version should also work just fine as would my test-command python script. The perl script requires TK and you must pipe its output to the serial port as it doesn&#39;t use an actual perl serial module or functions.

&lt;pre class=&quot;brush: perl&quot;&gt;#!/usr/bin/perl -w

# RobotControl is a program for controlling Robot Maxamilian&#39;s servos.
# Copyright (C) 1999  Patrick M. Rael
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#
# Use the Tk package
#
use Tk;


#
# Create the Main window, with a Menu of a few basic options, and a frame
#
my $mw = new MainWindow(-width  =&gt; &#39;400&#39;,
                        -height =&gt; &#39;400&#39;);
my $f = $mw-&gt;Frame(-relief =&gt; &#39;raised&#39;,
                   -background =&gt; &#39;blue2&#39;,
                   -borderwidth =&gt; 2);
$f-&gt;pack(-side =&gt; &#39;top&#39;,
         -anchor =&gt; &#39;n&#39;,
         -expand =&gt; 1,
         -fill =&gt; &#39;x&#39;);
my $fileMenu = $f-&gt;Menubutton(-text =&gt; &quot;File&quot;,
                              -tearoff =&gt; 0,
                              -background =&gt; &#39;blue2&#39;,
                              -menuitems =&gt; [
                                      [&#39;command&#39; =&gt; &quot;Quit&quot;,
                                       -command  =&gt; sub { exit } ]
                                   ])-&gt;pack( -side =&gt; &#39;left&#39;);

#
# Load several pictures of RMax
#


my $f2 = $mw-&gt;Frame(-relief =&gt; &#39;raised&#39;,
                    -borderwidth =&gt; 1)-&gt;pack();


#
# Create the Scale bars
#
$S0  = createScalebar($f2, &quot;Servo #1&quot;,   0,  0,254,  0,0);
$S1  = createScalebar($f2, &quot;Servo #2&quot;,   1,  0,254,  0,1);
$S2  = createScalebar($f2, &quot;Servo #3&quot;,   2,  0,254,  1,0);
$S3  = createScalebar($f2, &quot;Servo #4&quot;,   3,  0,254,  1,1);
$S4  = createScalebar($f2, &quot;Servo #5&quot;,   4,  0,254,  2,0);
$S5  = createScalebar($f2, &quot;Servo #6&quot;,   5,  0,254,  2,1);
$S6  = createScalebar($f2, &quot;Servo #7&quot;,   6,  254,0,  3,0);
$S7  = createScalebar($f2, &quot;Servo #8&quot;,   7,  0,254,  3,1);
$S13 = createScalebar($f2, &quot;S1-3&quot;,  -1,  0,254,  4,0);
$S57 = createScalebar($f2, &quot;S5-7&quot;,  -1,  0,254,  4,1);



$S13-&gt;configure(-command =&gt;  [\&amp;vscale_cb, $S0, $S2]);
$S57-&gt;configure(-command =&gt; [\&amp;vscale_cb, $S6, $S4]);



#
# Enter the main graphics event loop
#
MainLoop;


#
# Subroutine scale_cb() - Callback for a Scale bar change.
#
#     $sid [ServoID] is an integer I define from 0-7+ which is actually
#           a port number of the Mini-SSC-II.
#     $value is the value 0-254 of the Scale bar.  It seems to be passed in
#           Magically by Perl/Tk because I don&#39;t specify it.  What luck!
#
sub scale_cb {
    my ($sid, $value) = @_;

    #
    # Create a Packet of bytes: #255, Servo, Position
    #
    my $ch_sop = chr(255);     # char, start-of-packet, sop
    my $ch_sid = chr($sid);    # char, Servo-ID, sid
    my $ch_val = chr($value);  # char, Servo Position 0-254, val
    my $packet = &quot;$ch_sop$ch_sid$ch_val&quot;;
    print &quot;$packet&quot;;
}


#
# Subroutine vscale_cb() - Callback for driving two other servos.
#
sub vscale_cb {
    my ($slave1,$slave2,$value) = @_;

    $slave1-&gt;set($value);
    $slave2-&gt;set($value);
}


#
# Subroutine createScalebar() - Creates a Scale bar.
#
sub createScalebar {
    my ($container, $label,$servoID,$from,$to,$row,$col) = @_;

    my $sb = $container-&gt;Scale(-from =&gt; $from,
                               -to   =&gt; $to,
                               -label =&gt; &quot;$label&quot;,
                               -length =&gt; &#39;200&#39;,
                               -showvalue =&gt; &#39;1&#39;,
                               -tickinterval =&gt; &#39;50&#39;,
                               -orient  =&gt; &#39;horizontal&#39;,
                               -background =&gt; &#39;blue2&#39;,
                               -trough =&gt; &#39;cyan1&#39;,
                               -command =&gt; [ \&amp;scale_cb, $servoID] );
    $sb-&gt;grid(-row    =&gt; &quot;$row&quot;,
              -column =&gt; &quot;$col&quot;);

    return $sb;

}


#
# Subroutine place_image() - Loads &quot;Photo&#39;s&quot;
#
sub place_image {
    my ($container,$file,$x,$y) = @_;

    my $photo = $container-&gt;Photo(-file =&gt; $file);
    my $image = $container-&gt;createImage($x,$y, -image =&gt; $photo);
}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/2705258600289184612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/2705258600289184612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2705258600289184612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2705258600289184612'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/arduino-scott-mini-servo-motor-test-2.html' title='Arduino, Scott Mini Servo / motor test 2'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-2851858414970005154</id><published>2010-08-27T12:07:00.002-07:00</published><updated>2011-02-06T12:01:32.812-08:00</updated><title type='text'>Four legged crawling robot gets walk, turn and run cycles..</title><content type='html'>Ok, a while back I built this little monster.&amp;nbsp; I did some digging through my harddrive and found the python script I used to control the Scott Mini to make this guy walk, turn etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;344&quot; style=&quot;background-image: url(http://i1.ytimg.com/vi/tm9tuRvOnDE/hqdefault.jpg);&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/tm9tuRvOnDE?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/tm9tuRvOnDE?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
There is no micro controller code here because all 8 servos were ran by the scott mini servo controller.  I got the scott mini from Jameco, other controllers like pololu&#39;s series can do the same thing and the script can be adapted to fit them.  Also my Arduino servo controller code would work well with this script.&lt;br /&gt;
&lt;br /&gt;
In addition to running this strait from my Ubuntu box (soon to go Fedora Core 13), I have ran this code via Ubuntu Jaunty on my Hawkboard as well as Angstrom Linux and Windows boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/python
import time, sys, os, serial
 
#set up the serial port for action (0==COM1==ttyS0)
ser=serial.Serial(&#39;/dev/ttyUSB2&#39;)
ser.baudrate=9600
packet=0
 
def setpos(n,angle):
    packet=chr(255)+chr(n)+chr(angle)
    ser.write(packet)
 
def forward():
    STEP =[[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]]
    STEPLEN=len(STEP)
    #print &quot;Resetting postions&quot;
    for i in range(0,STEPLEN):
        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,170],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,170],[7,125]])
    STEP.extend([[0,125],[1,75],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,75],[2,125],[3,125],[4,125],[5,75],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,125],[4,85],[5,75],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,125],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,180],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,154],[3,180],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,154],[3,125],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,114],[1,125],[2,103],[3,125],[4,158],[5,125],[6,76],[7,129]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]])
 
 
    STEPLEN=len(STEP)
    for i in range(0,STEPLEN):
        time.sleep(.06)
        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
def runforward():
    STEP =[[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]]
    STEPLEN=len(STEP)
    #print &quot;Resetting postions&quot;
    for i in range(0,STEPLEN):
        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,170],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,170],[7,125]])
    STEP.extend([[0,125],[1,75],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,75],[2,125],[3,125],[4,125],[5,75],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,125],[4,85],[5,75],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,125],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,125],[3,180],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,154],[3,180],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,166],[1,125],[2,154],[3,125],[4,85],[5,125],[6,125],[7,129]])
    STEP.extend([[0,114],[1,125],[2,103],[3,125],[4,158],[5,125],[6,76],[7,129]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]])
 
 
    STEPLEN=len(STEP)
    for i in range(0,STEPLEN):
        time.sleep(.03)
        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
def left():
    STEP =[[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]]
    STEPLEN=len(STEP)
    #print &quot;Resetting postions&quot;
    for i in range(0,STEPLEN):
        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,203],[7,170]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,203],[7,129]])
    STEP.extend([[0,125],[1,125],[2,63],[3,170],[4,125],[5,125],[6,203],[7,129]])
    STEP.extend([[0,125],[1,125],[2,63],[3,125],[4,125],[5,63],[6,203],[7,129]])
    STEP.extend([[0,125],[1,125],[2,63],[3,125],[4,84],[5,63],[6,203],[7,129]])
    STEP.extend([[0,125],[1,68],[2,63],[3,125],[4,84],[5,125],[6,203],[7,129]])
    STEP.extend([[0,76],[1,125],[2,63],[3,125],[4,84],[5,125],[6,203],[7,129]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,129]])
    STEPLEN=len(STEP)
    for i in range(0,STEPLEN):
        time.sleep(.03)
        ##print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
 
def right():
    STEP =[[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,119]]
    STEPLEN=len(STEP)
    #print &quot;Resetting postions&quot;
    for i in range(0,STEPLEN):
#        #print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,119]])
    STEP.extend([[0,125],[1,56],[2,125],[3,125],[4,125],[5,125],[6,125],[7,119]])
    STEP.extend([[0,182],[1,56],[2,125],[3,125],[4,125],[5,125],[6,125],[7,119]])
    STEP.extend([[0,182],[1,125],[2,125],[3,125],[4,196],[5,60],[6,125],[7,119]])
    STEP.extend([[0,182],[1,125],[2,125],[3,180],[4,196],[5,125],[6,125],[7,177]])
    STEP.extend([[0,182],[1,125],[2,178],[3,125],[4,196],[5,125],[6,64],[7,119]])
    STEP.extend([[0,125],[1,125],[2,125],[3,125],[4,125],[5,125],[6,125],[7,119]])
 
 
 
    STEPLEN=len(STEP)
    for i in range(0,STEPLEN):
        time.sleep(.03)
#        print &quot;Servo ID:&quot;+str(STEP[i][0])+&quot;Position:&quot;+str(STEP[i][1])
        setpos(STEP[i][0],STEP[i][1])
 
 
os.popen(&#39;echo &quot;My User, Grid bug one on line. Please, give me a direction F for forward,L for left turn,R for right turn&quot; |espeak --stdin&#39;)
os.popen(&#39;echo &quot;Capitol F for run forward&quot; |espeak --stdin&#39;)
print &quot;Please, give me a direction F for forward,L for left turn,R for right turn&quot;
print &quot;Capitol F for run forward&quot;
 
readkey = None
while readkey != &quot;x&quot;:
  readkey=raw_input(&#39;Need Input:&#39;)
  os.popen(&#39;echo &quot;Need Input:&quot; |espeak --stdin&#39;)
  print &quot;Result:&quot;+str(readkey)
  if readkey == &quot;f&quot;:
   print &quot;You told me forward!&quot;
   os.popen(&#39;echo &quot;Forward, yes my user&quot; |espeak --stdin&#39;)
   forward()
  if readkey == &quot;l&quot;:
   print &quot;You told me left!&quot;
   os.popen(&#39;echo &quot;Left, yes my user&quot; |espeak --stdin&#39;)
   left()
   left()
   left()
 
  if readkey == &quot;r&quot;:
   print &quot;You told me right!&quot;
   os.popen(&#39;echo &quot;Right, yes my user&quot; |espeak --stdin&#39;)
   right()
   right()
   right()
 
  if readkey == &quot;F&quot;:
   print &quot;You told me Run forward!&quot;
   os.popen(&#39;echo &quot;Run little users run!&quot; |espeak --stdin&#39;)
   runforward()
   runforward()
   runforward()
 
if readkey == &quot;x&quot;:
    print &quot;End Of Line!&quot;
    os.popen(&#39;echo &quot;End Of line!&quot; |espeak --stdin&#39;)




&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/2851858414970005154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/2851858414970005154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2851858414970005154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/2851858414970005154'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/four-legged-crawling-robot-gets-walk.html' title='Four legged crawling robot gets walk, turn and run cycles..'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-6754617880083984606</id><published>2010-08-27T12:07:00.001-07:00</published><updated>2010-08-31T14:06:52.802-07:00</updated><title type='text'>New recording of the quadraped walking.</title><content type='html'>This lil guy was done using a Scott Mini 8 servo controller and 8 servos, 7 futaba 1 Hi Tech. The body was done entirely in hobby metal with some standoffs and cut foam gasket material.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;object height=&quot;344&quot; style=&quot;background-image: url(http://i2.ytimg.com/vi/EOaxzE31iec/hqdefault.jpg);&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/EOaxzE31iec?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/EOaxzE31iec?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;
The perl code here was used to figure out the positions needed for the various walk cycles.&amp;nbsp; I also at one point linked up the HawkBoard and was using it to drive the serial to usb addaptor controlling the bug(?).&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
#!/usr/bin/perl -w
 
# RobotControl is a program for controlling Robot Maxamilian&#39;s servos.
# Copyright (C) 1999  Patrick M. Rael
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
#
# Use the Tk package
#
use Tk;
 
 
#
# Create the Main window, with a Menu of a few basic options, and a frame
#
my $mw = new MainWindow(-width  =&amp;gt; &#39;400&#39;,
                        -height =&amp;gt; &#39;400&#39;);
my $f = $mw-&amp;gt;Frame(-relief =&amp;gt; &#39;raised&#39;,
                   -background =&amp;gt; &#39;blue2&#39;,
                   -borderwidth =&amp;gt; 2);
$f-&amp;gt;pack(-side =&amp;gt; &#39;top&#39;,
         -anchor =&amp;gt; &#39;n&#39;,
         -expand =&amp;gt; 1,
         -fill =&amp;gt; &#39;x&#39;);
my $fileMenu = $f-&amp;gt;Menubutton(-text =&amp;gt; &quot;File&quot;,
                              -tearoff =&amp;gt; 0,
                              -background =&amp;gt; &#39;blue2&#39;,
                              -menuitems =&amp;gt; [
                                      [&#39;command&#39; =&amp;gt; &quot;Quit&quot;,
                                       -command  =&amp;gt; sub { exit } ]
                                   ])-&amp;gt;pack( -side =&amp;gt; &#39;left&#39;);
 
#
# Load several pictures of RMax
#
 
 
my $f2 = $mw-&amp;gt;Frame(-relief =&amp;gt; &#39;raised&#39;,
                    -borderwidth =&amp;gt; 1)-&amp;gt;pack();
 
 
#
# Create the Scale bars
#
$S0            = createScalebar($f2, &quot;Servo #1&quot;,      0,  0,254,  0,0);
$S1            = createScalebar($f2, &quot;Servo #2&quot;,      1,  0,254,  0,1);
$S2            = createScalebar($f2, &quot;Servo #3&quot;,      2,  0,254,  1,0);
$S3            = createScalebar($f2, &quot;Servo #4&quot;,      3,  0,254,  1,1);
$S4            = createScalebar($f2, &quot;Servo #5&quot;,       4,  0,254,  2,0);
$S5            = createScalebar($f2, &quot;Servo #6&quot;,        5,  0,254,  2,1);
$S6            = createScalebar($f2, &quot;Servo #7&quot;,          6,  0,254,  3,0);
$S7            = createScalebar($f2, &quot;Servo #8&quot;,          7,  0,254,  3,1);
 
 
 
#
# Enter the main graphics event loop
#
MainLoop;
 
 
 
#
# Subroutine scale_cb() - Callback for a Scale bar change.
#
#     $sid [ServoID] is an integer I define from 0-7+ which is actually
#           a port number of the Mini-SSC-II.
#     $value is the value 0-254 of the Scale bar.  It seems to be passed in
#           Magically by Perl/Tk because I don&#39;t specify it.  What luck!
#
sub scale_cb {
    my ($sid, $value) = @_;
 
    #
    # Create a Packet of bytes: #255, Servo, Position
    #
    my $ch_sop = chr(255);     # char, start-of-packet, sop
    my $ch_sid = chr($sid);    # char, Servo-ID, sid
    my $ch_val = chr($value);  # char, Servo Position 0-254, val
    my $packet = &quot;$ch_sop$ch_sid$ch_val&quot;;
    print &quot;$packet&quot;;
}
 
 
#
# Subroutine vscale_cb() - Callback for driving two other servos.
#
sub vscale_cb {
    my ($slave1,$slave2,$value) = @_;
 
    $slave1-&amp;gt;set($value);
    $slave2-&amp;gt;set($value);
}
 
 
#
# Subroutine createScalebar() - Creates a Scale bar.
#
sub createScalebar {
    my ($container, $label,$servoID,$from,$to,$row,$col) = @_;
 
    my $sb = $container-&amp;gt;Scale(-from =&amp;gt; $from,
                               -to   =&amp;gt; $to,
                               -label =&amp;gt; &quot;$label&quot;,
                               -length =&amp;gt; &#39;200&#39;,
                               -showvalue =&amp;gt; &#39;1&#39;,
                               -tickinterval =&amp;gt; &#39;50&#39;,
                               -orient  =&amp;gt; &#39;horizontal&#39;,
                               -background =&amp;gt; &#39;blue2&#39;,
                               -trough =&amp;gt; &#39;cyan1&#39;,
                               -command =&amp;gt; [ \&amp;amp;scale_cb, $servoID] );
    $sb-&amp;gt;grid(-row    =&amp;gt; &quot;$row&quot;,
              -column =&amp;gt; &quot;$col&quot;);
 
    return $sb;
 
}
 
 
#
# Subroutine place_image() - Loads &quot;Photo&#39;s&quot;
#
sub place_image {
    my ($container,$file,$x,$y) = @_;
 
    my $photo = $container-&amp;gt;Photo(-file =&amp;gt; $file);
    my $image = $container-&amp;gt;createImage($x,$y, -image =&amp;gt; $photo);
}


&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
I will dig up the old walk command code later and edit this post.</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/6754617880083984606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/6754617880083984606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6754617880083984606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6754617880083984606'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/new-recording-of-quadraped-walking.html' title='New recording of the quadraped walking.'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-6720530612556444296</id><published>2010-08-27T12:07:00.000-07:00</published><updated>2010-08-27T12:07:02.130-07:00</updated><title type='text'>Exploring Arduino 1</title><content type='html'>&lt;object style=&quot;background-image:url(http://i4.ytimg.com/vi/GpdFNaUsop0/hqdefault.jpg)&quot;  width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/GpdFNaUsop0?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/GpdFNaUsop0?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/6720530612556444296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/6720530612556444296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6720530612556444296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/6720530612556444296'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/exploring-arduino-1.html' title='Exploring Arduino 1'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-1811102682000528445</id><published>2010-08-27T12:06:00.003-07:00</published><updated>2010-08-27T12:06:49.133-07:00</updated><title type='text'>MigaMotors and the Arduino board</title><content type='html'>&lt;object style=&quot;background-image:url(http://i3.ytimg.com/vi/jKP79E7HoXg/hqdefault.jpg)&quot;  width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/jKP79E7HoXg?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/jKP79E7HoXg?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/1811102682000528445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/1811102682000528445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1811102682000528445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/1811102682000528445'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/migamotors-and-arduino-board.html' title='MigaMotors and the Arduino board'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6475726489711554308.post-8016955590516993750</id><published>2010-08-27T12:06:00.002-07:00</published><updated>2011-02-06T12:06:01.477-08:00</updated><title type='text'>Hawkboard test</title><content type='html'>Based on notes from &lt;a href=&quot;http://elinux.org/Hawkboard#Booting_Linux_Kernel_from_SD_OR_MMC&quot;&gt;Booting_Linux_Kernel_from_SD_OR_MMC&lt;/a&gt;, which I will duplicate here.&amp;nbsp; Using an image built from the &lt;a href=&quot;http://www.angstrom-distribution.org/&quot;&gt;Angstrom Linux&lt;/a&gt;.&amp;nbsp; I tested various basic functions of the Hawkboard.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;344&quot; style=&quot;background-image: url(&amp;quot;http://i4.ytimg.com/vi/7vMHbORfN7Q/hqdefault.jpg&amp;quot;);&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/7vMHbORfN7Q?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/7vMHbORfN7Q?fs=1&amp;amp;hl=en_US&quot; width=&quot;425&quot; height=&quot;344&quot; allowScriptAccess=&quot;never&quot; allowFullScreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
Additionally, though not shown in the video but will be reposted later I verified Android, Ubuntu Jaunty and will be exploring Fedora Embedded.&amp;nbsp; My main interest in this board is as&amp;nbsp; a main controller / networking link for robotics.&amp;nbsp; In my tests I loaded Python, Perl, php, ruby and a few other languages just to verify the potential of the board.&amp;nbsp; It has more than enough processing power to do more advanced AI like PyBrain, PyAIML and many other AI examples.&amp;nbsp; I also explored video capture, audio capture and output of both.&amp;nbsp; My findings were that the Hawkboard design was sufficiant it was lacking in driver support / integration in the multimedia area.&amp;nbsp; Additionally the Audio input it seems is stereo line in, shy of a mixer to boost a microphone input there is no other direct way to capture audio for speech recognition.&lt;br /&gt;
&lt;br /&gt;
Below is an excerpt of the relavent bits.&lt;br /&gt;
&lt;br /&gt;
There are a few gotchas,&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;If you write the kernel to nand you must clear, load u-boot and perform the kernel steps.&amp;nbsp; If you don&#39;t make certain uboot is in nand and peform a uImage (kernel) update / write you will have to reset the board using the uartboot as noted in the wiki.&lt;/li&gt;
&lt;li&gt;Kernel size is tricky to properly write a new kernel you need to make sure you clear, load and write with the right size ranges.&amp;nbsp; Otherwise your kernel will not load or won&#39;t load consistantly.&lt;/li&gt;
&lt;/ol&gt;Ok had some time this weekend, this is different slightly than my main video.&amp;nbsp; However I will be posting new videos shortly.&lt;br /&gt;
&lt;br /&gt;
&lt;h1 class=&quot;western&quot;&gt;Ubuntu Jaunty on Hawkboard,&lt;/h1&gt;&lt;br /&gt;
TFTP/MMC Method,&lt;br /&gt;
Setting up the mmc card,&lt;br /&gt;
&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/KGG-mozGZa8?hl=en&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/KGG-mozGZa8?hl=en&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt; &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
This is very important, configuring a kernel or u-boot can gimp a board and force you to attempt to recover the board..&lt;br /&gt;
&lt;/B&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;  hawkboard.org &gt; setenv serverip 172.24.156.199
  hawkboard.org &gt; setenv ipaddr 172.24.190.58
  hawkboard.org &gt; tftpboot 0xc0700000 u-boot_nand_ais.bin
  
  TFTP from server 172.24.156.199; our IP address is 172.24.190.58
  Filename &#39;u-boot_nand_ais.bin&#39;.
  Load address: 0xc0700000
  Loading: #################################################################
           #################
  done
  Bytes transferred = 414988 (6550c hex)
  hawkboard.org &gt; nand erase

  NAND erase: device 0 whole chip
  OK
  hawkboard.org &gt; nand write.e 0xc0700000 0x20000 0x70000
    NAND write: device 0 offset 0x20000, size 0x70000
  458752 bytes written: OK
  hawkboard.org &gt;tftp c0700000 uImage
  hawkboard.org &gt;nand erase 200000 200000
  hawkboard.org &gt;nand write.e 0xc0700000 0x200000 0x200000
  ###Verify.. 
  hawkboard.org &gt;nand read.e 0xc0700000 0x200000 0x200000



&lt;/pre&gt;&lt;b&gt;&lt;br /&gt;
This is very important, configuring a kernel or u-boot can gimp a board and force you to attempt to recover the board..&lt;br /&gt;
&lt;/B&gt;&lt;br /&gt;
&lt;p&gt;Configuring and preping u-boot and the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/oAglL7CbuDA?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/oAglL7CbuDA?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;/p&gt;&lt;pre class=&quot;brush: c&quot;&gt;
hawkboard.org &gt; set serverip 192.168.2.24 

hawkboard.org &gt; setenv bootargs &quot;mem=128M console=ttyS2,115200n8 root=/dev/mmcblk0p4 rootwait rw init=/sbin/init ip=192.168&quot; 

hawkboard.org &gt; setenv bootcmd &#39;setenv bootargs $bootargs;tftp c0700000 uImage; bootm c0700000&#39; 

&lt;/pre&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;hawkboard.org &gt; boot 

TFTP from server 192.168.2.24; our IP address is 192.168.2.200 

Filename &#39;uImage&#39;. 

Load address: 0xc0900000 

Loading: ################################################################# 

################################################################# 

################################################################# 

################################################################# 

################################################################# 

##################################################### 

done 

Bytes transferred = 1934036 (1d82d4 hex) 

## Booting kernel from Legacy Image at c0900000 ... 

Image Name:   Linux-2.6.32-rc6-00079-g55996fd- 

Image Type:   ARM Linux Kernel Image (uncompressed) 

Data Size:    1933972 Bytes =  1.8 MB 

Load Address: c0008000 

Entry Point:  c0008000 

Verifying Checksum ... OK 

Loading Kernel Image ... OK 

OK 



Starting kernel ... 



Linux version 2.6.32-rc6-00079-g55996fd-dirty (root@khasim-laptop) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #2 P9 

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177 

CPU: VIVT data cache, VIVT instruction cache 

Machine: OMAPL 138 Hawkboard.org 

Memory …... … . 

.. …. .. . . blah blah blah :)     

[ OK ]ting up console font and keymap...        

* Starting system log daemon...        

Ubuntu 9.04 Alok-PC ttyS2 


[ OK ]C login: 

[ OK ] * Starting kernel log daemon...        

[ OK ] * Starting OpenBSD Secure Shell server sshd        

[ OK ] * Starting periodic command scheduler crond
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://auzieman.blogspot.com/feeds/8016955590516993750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6475726489711554308/8016955590516993750' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8016955590516993750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6475726489711554308/posts/default/8016955590516993750'/><link rel='alternate' type='text/html' href='http://auzieman.blogspot.com/2010/08/hawkboard-test.html' title='Hawkboard test'/><author><name>auzieman</name><uri>http://www.blogger.com/profile/15588367540271882215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWK9_eBMPcXVg2_ttV2KUbKxNeyKt2hIPb0BSfuKjqeQmbKEwCmJViRokiKV3m5ApqQbvAkbsfI0lUfdzJ6v7WlrWTKFRjf3O8DWIa4tHQrwLYBpisL-MMQkO217oRg/s220/auzthumb.jpg'/></author><thr:total>5</thr:total></entry></feed>