<div dir="ltr"><div><div><div><div><div><div><div>Hey Martin / all,<br><br></div>Had to put this down for a few days but back at it today.<br><br></div>Finally got it working - huzzah!<br><br></div>I changed the c file so that although it&#39;s gpio17 it&#39;s actually pin 11 (define_SENSOR_SELECT_PIN) and boom!<br>
Why the numbering scheme is so confusing is beyond me but anyway.<br><br></div>Also for us we&#39;re running the IC at 5v as well as the 10k resistors on the clock line.<br><br></div>Thanks again Martin - you rock.<br><br>
</div>Have a great weekend,<br><br></div>Julian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 May 2013 18:17, Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca" target="_blank">martin.peach@sympatico.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-05-03 12:34, Julian Brooks wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok - thanks for that, makes more sense now.<br>
<br>
When I run the C code this happens:<br>
<br>
&quot;./jb_d6t_reader_ic3 0<br>
...export file accessed, new pin now accessible<br>
...direction set to output<br>
./jb_d6t_reader_ic3: initialized:0<br>
Write failed (5)<br>
 &gt;&gt; Input/output error &lt;&lt;<br>
...unexport file accessed, pin now inaccessible&quot;<br>
<br>
I&#39;ve done my best to go through the code and make changes where appropriate.<br>
<br>
Replaced D6T8L with DRT44L2 and changed packet size.<br>
Altered all references for 2nd sensor to DRT44L2 and also changed i2c-1<br>
to 0 for rev1 board.<br>
<br>
Weirdly I can&#39;t access the i2c bus anymore?<br>
cat /dev/i2c*<br>
cat: /dev/i2c-0: Input/output error<br>
cat: /dev/i2c-1: Input/output error<br>
<br>
</blockquote>
<br></div>
Yes I get that too. (unless the sensor returns one byte it&#39;s probably normal) But &quot;i2cdetect -y 1&quot; still shows a sensor at 0x0A.<br>
I run the code as &quot;sudo ./d6t_reader 0&quot;, otherwise I don&#39;t have permission to set the GPIO pin.<br>
I don&#39;t get any write errors though.<br>
Are you writing to the correct i2c?<br>
There are two places in the code that could throw the write error. Maybe change the message so you can tell which one it is.<br>
Anyway the setup should work with the old code (only one sensor), the 4051 circuit should have no effect on the communication betwen the Pi and one of the sensors, the select pin select which sensor receives the clock. So if the older code isn&#39;t working the circuit is wrong, otherwise the code is buggy.<span class="HOEnZb"><font color="#888888"><br>

<br>
Martin<br>
<br>
</font></span></blockquote></div><br></div>