Matt,<div><br></div><div>Great!...Yes, I have the research paper published on the Flying Gator and was using that as a starting point...thanks for the link to the code in the repository. I didn&#39;t even think to check there.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style>So, while it isn&#39;t &quot;new&quot;, it still is the code<br>
</span><span style>that flew the actual aircraft.</span></blockquote><div><br></div><div>It looks like many of my needs have already been written in a more concurrent fashion than I would have written them, which is nice.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style>you can see where we do an ADC read; there&#39;s an umber of constants and<br>
</span><span style>channel arrays there, but put simply:</span><br style><span style>   adc(GYRO.X, AREF, sig.gyro[X]?, gyro.out[X]!)</span></blockquote><div><br></div><div><br></div><div>This was exactly what I was starting to write, and the channel arrays in this PROC portend some questions in the near future.<br>
</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style>note that you&#39;ll want to look at the *architecture specific* code (in<br>
</span><span style>the &quot;arch&quot; directory), because we had to do different things on the<br></span><span style>328, 1280, and 2560 (as the ADC is hardware dependent).</span></blockquote><div><span style><br></span></div>
<div><span style>I will pay attention to this...thanks for the heads-up.</span></div><div><span style><br></span></div><div><span style><br></span></div><div>On a side note, I am trying to wirelessly program the Arduino 328 with an XBee series 1 radio...I have been able to send and receive serial data using occam wirelessly after the Arduino is programmed, but I was hoping to be able to program the board after it is embedded.</div>
<div><br></div><div>Have you ever tried this?  </div><div><br></div><div>Thanks again for the quick response.</div><div><br></div><div>aaron</div><div><br></div><div><br></div><div><br></div><div>  <br><br><div class="gmail_quote">
On Sat, Jun 23, 2012 at 7:54 AM, Matt Jadud <span dir="ltr">&lt;<a href="mailto:matt@jadud.com" target="_blank">matt@jadud.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Aaron,<br>
<div class="im"><br>
On Sat, Jun 23, 2012 at 1:56 AM, Aaron Ryan &lt;<a href="mailto:bringfire@gmail.com">bringfire@gmail.com</a>&gt; wrote:<br>
&gt; I am putting together an IMU with my two axis gyro and three axis<br>
&gt; accelerometer. I was wondering if there is any way to implement an<br>
&gt; &quot;analogReference()&quot; equivalent in occam.  I&#39;m uncertain how the Atmega328<br>
&gt; uses it&#39;s AREF pin, so any help on the simple concepts behind the function<br>
&gt; will help...PORT info, etc..<br>
<br>
</div>Actually, in the same place some of your code lives...<br>
<br>
<a href="http://projects.cs.kent.ac.uk/projects/kroc/svn/kroc/trunk/tvm/arduino/community/" target="_blank">http://projects.cs.kent.ac.uk/projects/kroc/svn/kroc/trunk/tvm/arduino/community/</a><br>
<br>
is the &quot;gatoruav&quot; directory. That is where the code for our UAV<br>
project lives. We spent the last year redesigning (and then<br>
redesigning again) the physical aircraft, and prototyping control code<br>
against a simulator. So, while it isn&#39;t &quot;new&quot;, it still is the code<br>
that flew the actual aircraft.<br>
<br>
In the Trac browsing interface:<br>
<br>
<a href="http://projects.cs.kent.ac.uk/projects/kroc/trac/browser/kroc/trunk/tvm/arduino/community/gatoruav/" target="_blank">http://projects.cs.kent.ac.uk/projects/kroc/trac/browser/kroc/trunk/tvm/arduino/community/gatoruav/</a><br>

<br>
you can see where we do an ADC read; there&#39;s an umber of constants and<br>
channel arrays there, but put simply:<br>
<br>
    adc(GYRO.X, AREF, sig.gyro[X]?, gyro.out[X]!)<br>
<br>
or, you can dig down into the Plumbing libraries, and find the ADC<br>
code there, which is more procedural (vs. concurrent):<br>
<br>
<a href="http://projects.cs.kent.ac.uk/projects/kroc/trac/browser/kroc/trunk/tvm/arduino/occam/include/arch/m328p/adc.module" target="_blank">http://projects.cs.kent.ac.uk/projects/kroc/trac/browser/kroc/trunk/tvm/arduino/occam/include/arch/m328p/adc.module</a><br>

<br>
note that you&#39;ll want to look at the *architecture specific* code (in<br>
the &quot;arch&quot; directory), because we had to do different things on the<br>
328, 1280, and 2560 (as the ADC is hardware dependent).<br>
<br>
If that doesn&#39;t get you started, please ask away. I guess the short<br>
answer is &quot;Yes, AREF is a parameter to the ADC read call.&quot;<br>
<br>
Cheers,<br>
Matt<br>
</blockquote></div><br></div>