Oh... what do you mean 17 and 18? if i change the analog ins 4-5 to digital output?... ill try this solution and tomorrow i send a post.<br><br>Very thanks for the support<br><br>Best regards from Chile<br><br>JOsé<br><br>
<br><br><br><div class="gmail_quote">2009/11/1 Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It should work with the [comport] object.<br>
You need on the Arduino to set analog 4 and 5 as digital outputs (I think they are digital 17 &amp; 18). Set the pin connected to the accelerometer module&#39;s 5V pin HIGH and the Gnd pin LOW. That will provide enough current for the accelerometer to work. Then you need to do analogRead() on the three accel pins and split each value into two bytes. Then send all six bytes via Serial.print(val, BYTE) commands.<br>

In a Pd patch you need to reassemble each packet of six bytes into three floats.<br>
Obviously the baud rate must be the same at both ends but it can be very fast, like 115200.<br>
It might help to have the Arduino send samples only when requested by the Pd patch, that way you can be sure of getting the six bytes into the correct frame, otherwise it&#39;s not certain which is the first (unless you add a header byte that is always the same).<br>

<br>
I find it easier to do this without using the firmata or pduino stuff, because it&#39;s an unusual implementation. If you want to use pduino, it&#39;s better to connect your module power pins to the Arduino power pins and just read analog 0 1 2.<br>

<br>
Martin<br>
<br>
<br>
<br>
Jose Luis Santorcuato wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Thanks, that is the regular connection, but not working... maybe the capacitor... in the past i worked with ir, potentiometer, bottoms, all the sensors, but the acellerometer dont work in pd...very strange...<br>
When y program in Arduino all works fine.... how can i connect the serial to Pd?... with the same firmatas objetc?<br>
<br>
Thanks a lot, but the sensor not working in the habitual order.<br>
<br>
Somebody?<br>
<br>
Thanks a lot people<br>
<br>
Best regards<br>
<br>
Chile<br>
<br>
JOsé<br></div>
2009/11/1 slimboyfatboyslim &lt;<a href="mailto:slimboyfatboyslim@slimboyfatboyslim.org" target="_blank">slimboyfatboyslim@slimboyfatboyslim.org</a> &lt;mailto:<a href="mailto:slimboyfatboyslim@slimboyfatboyslim.org" target="_blank">slimboyfatboyslim@slimboyfatboyslim.org</a>&gt;&gt;<div>
<div></div><div class="h5"><br>
<br>
    hi,<br>
<br>
    Is there any specific reasons why you connect both GND and VCC to<br>
    AIN of Arduino?<br>
<br>
    The typical connection should be <br>
    AXL (GND) -&gt; Arduino (GND)<br>
    AXL (VCC) -&gt; Arduino (3V3) (check the  datasheet if VCC = 1.8V-3.8V)<br>
    AXL (X) -&gt; Arduino (A0)<br>
    AXL (Y) -&gt; Arduino (A1)<br>
    AXL (Z) -&gt; Arduino (A2)<br>
<br>
    enable analog in in firmata, then should give you some readings,<br>
<br>
    use a small capacitor across XYZ and arduino to avoid noise<br>
<br>
    On Nov 1, 2009, at 12:26 AM, Jose Luis Santorcuato wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
<br>
    Dear friends, I&#39;m working on connecting to the pduino arduino with<br>
    a three-axis accelerometer (sparkfun), when I program from the<br>
    arduino ide I connect the three axis, gnd and voltage directly to<br>
    the five analogs ins and from the console terminal reads well,<br>
    what would be the possibility of connection to incorporate the<br>
    sensor into pduino?.<br>
<br>
    The connection I make in the arduino ide bd begins with 9600, but<br>
    the firmata works to 57,600 bd.<br>
<br>
    How do the circuit?, or does it need to be rewritten from the<br>
    firmata?.<br>
<br>
    I send the picture of Igoe conecction and works fine (in arduino ide).<br>
<br>
<br>
    Best regards<br>
<br>
<br>
    José Chile<br>
<br>
<br>
<br>
    --     <a href="http://www.chilemigra.cl" target="_blank">http://www.chilemigra.cl</a><br>
    <a href="http://arselectronicachile.blogspot.com" target="_blank">http://arselectronicachile.blogspot.com</a><br>
    <a href="http://www.myspace.com/santorcuato" target="_blank">http://www.myspace.com/santorcuato</a><br>
<br>
<br>
    &lt;ArduinoADXL322.jpg&gt;_______________________________________________<br></div></div>
    <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> &lt;mailto:<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a>&gt; mailing list<div class="im"><br>
    UNSUBSCRIBE and account-management -&gt;<br>
    <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></blockquote><div class="im">
<br>
<br>
<br>
<br>
-- <br>
<a href="http://www.chilemigra.cl" target="_blank">http://www.chilemigra.cl</a><br>
<a href="http://arselectronicachile.blogspot.com" target="_blank">http://arselectronicachile.blogspot.com</a><br>
<a href="http://www.myspace.com/santorcuato" target="_blank">http://www.myspace.com/santorcuato</a><br>
<br>
<br>
<br></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.chilemigra.cl">http://www.chilemigra.cl</a><br><a href="http://arselectronicachile.blogspot.com">http://arselectronicachile.blogspot.com</a><br><a href="http://www.myspace.com/santorcuato">http://www.myspace.com/santorcuato</a><br>
<br><br>