<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AIN4-20mA Unit to Arduino Nano Every]]></title><description><![CDATA[<p dir="auto">I am trying to talk to the module using a Nano Every using the standard wire example, I get no output at all.  If I use a sniffing sketch, it detects the device on 0x55 so it is visible on the bus.</p>
<pre><code>#include &lt;Wire.h&gt;

void setup() {
  Wire.begin(8);        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
}

void loop() {
  Wire.requestFrom(0x55, 8);    // request 8 bytes from slave device 0x55

  while (Wire.available()) { // slave may send less than requested
    char c = Wire.read(); // receive a byte as character
    Serial.print(c,DEC);         // print the character
  }

  delay(250);
}
</code></pre>
<p dir="auto">I have a 4-20mA current source which I can measure, so I am confident I have a variable input.</p>
<p dir="auto">I have not used I2C before, I am confident the Arduino libraries are correct, so any pointers to what it might be would be appreciated.  Thanks.</p>
]]></description><link>https://community.m5stack.com/topic/7024/ain4-20ma-unit-to-arduino-nano-every</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Mar 2026 21:05:44 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7024.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Nov 2024 10:01:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 16:48:57 GMT]]></title><description><![CDATA[<p dir="auto">I think the MODULE_4_20MA (in the src folder) is only using some standard libraries:<br />
From top <a href="https://github.com/m5stack/M5Module-4-20mA/blob/main/src/MODULE_4_20MA.h" target="_blank" rel="noopener noreferrer nofollow ugc">src/MODULE_4_20MA.h</a>:</p>
<pre><code>#ifndef __MODULE_4_20MA_H
#define __MODULE_4_20MA_H

#include "Arduino.h"
#include "Wire.h"
</code></pre>
<p dir="auto">Try to download only the two files in the src-folder and see if you can include them into your project and compile.</p>
<p dir="auto">Also: If you look at the code in <a href="https://github.com/m5stack/M5Module-4-20mA/blob/main/src/MODULE_4_20MA.cpp" target="_blank" rel="noopener noreferrer nofollow ugc">src/MODULE_4_20MA.cpp</a> you'll see that they include some <em><strong>register</strong></em> addresses, maybe that is required for this AIN4-20mA unit?</p>
]]></description><link>https://community.m5stack.com/post/27196</link><guid isPermaLink="true">https://community.m5stack.com/post/27196</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Thu, 28 Nov 2024 16:48:57 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 15:56:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/30733">@Cognitive5525</a> said in <a href="/post/27192">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> said in <a href="/post/27190">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<pre><code>@spectrad have you tried with the M5Stack example here?
</code></pre>
<p dir="auto">No as I am not using an M5Stack, I am trying to use an Arduino Nano Every.</p>
</blockquote>
<p dir="auto">Ah sorry I overlooked that, but even though you're not using a M5stack MC I still believe that you might be able to get some "inspiration" from it. Have a look at the module MODULE_4_20MA in src-folder. As far as I can see it does not rely on any special M5stack libraries at this level.</p>
</blockquote>
<p dir="auto">Although you are not wrong about getting inspiration from it, using the Arduino Wire functions I should get something (and they do detect the device), the M5 library really just decodes the values its reading using the M5 version of the wire library (I assume, I don't know the M5).</p>
<p dir="auto">I am not reading anything from the module using I2c (a standard protocol), that's the bit I don't understand, if I can read some data back, I can manipulate it from there to get a reading, it's just I don't get data, so I am left scratching my head.</p>
]]></description><link>https://community.m5stack.com/post/27193</link><guid isPermaLink="true">https://community.m5stack.com/post/27193</guid><dc:creator><![CDATA[spectrad]]></dc:creator><pubDate>Thu, 28 Nov 2024 15:56:51 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 15:24:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> said in <a href="/post/27190">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<pre><code>@spectrad have you tried with the M5Stack example here?
</code></pre>
<p dir="auto">No as I am not using an M5Stack, I am trying to use an Arduino Nano Every.</p>
</blockquote>
<p dir="auto">Ah sorry I overlooked that, but even though you're not using a M5stack MC I still believe that you might be able to get some "inspiration" from it. Have a look at the module MODULE_4_20MA in src-folder. As far as I can see it does not rely on any special M5stack libraries at this level.</p>
]]></description><link>https://community.m5stack.com/post/27192</link><guid isPermaLink="true">https://community.m5stack.com/post/27192</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Thu, 28 Nov 2024 15:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 15:08:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/30733">@Cognitive5525</a> said in <a href="/post/27189">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> have you tried with the M5Stack example <a href="https://github.com/m5stack/M5Module-4-20mA" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>?</p>
</blockquote>
<p dir="auto">he doesn't have M5Stack controller, only M5Stack sensor trying to read back to Arduino NANO so not esp32 board.</p>
]]></description><link>https://community.m5stack.com/post/27191</link><guid isPermaLink="true">https://community.m5stack.com/post/27191</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Thu, 28 Nov 2024 15:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 14:52:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/30733">@Cognitive5525</a> said in <a href="/post/27189">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> have you tried with the M5Stack example <a href="https://github.com/m5stack/M5Module-4-20mA" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>?</p>
</blockquote>
<p dir="auto">No as I am not using an M5Stack, I am trying to use an Arduino Nano Every.</p>
]]></description><link>https://community.m5stack.com/post/27190</link><guid isPermaLink="true">https://community.m5stack.com/post/27190</guid><dc:creator><![CDATA[spectrad]]></dc:creator><pubDate>Thu, 28 Nov 2024 14:52:43 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 14:25:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> have you tried with the M5Stack example <a href="https://github.com/m5stack/M5Module-4-20mA" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>?</p>
]]></description><link>https://community.m5stack.com/post/27189</link><guid isPermaLink="true">https://community.m5stack.com/post/27189</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Thu, 28 Nov 2024 14:25:20 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 14:13:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/5596">@robski</a> I assumed as it was I2C then anything that had an I2C port should work as it's a standard protocol, but I could be wrong as well.</p>
]]></description><link>https://community.m5stack.com/post/27188</link><guid isPermaLink="true">https://community.m5stack.com/post/27188</guid><dc:creator><![CDATA[spectrad]]></dc:creator><pubDate>Thu, 28 Nov 2024 14:13:52 GMT</pubDate></item><item><title><![CDATA[Reply to AIN4-20mA Unit to Arduino Nano Every on Thu, 28 Nov 2024 13:19:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191289">@spectrad</a> said in <a href="/post/27183">AIN4-20mA Unit to Arduino Nano Every</a>:</p>
<blockquote>
<p dir="auto">I am trying to talk to the module using a Nano Every using the standard wire example, I get no output at all.  If I use a sniffing sketch, it detects the device on 0x55 so it is visible on the bus.</p>
<pre><code>#include &lt;Wire.h&gt;

void setup() {
  Wire.begin(8);        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
}

void loop() {
  Wire.requestFrom(0x55, 8);    // request 8 bytes from slave device 0x55

  while (Wire.available()) { // slave may send less than requested
    char c = Wire.read(); // receive a byte as character
    Serial.print(c,DEC);         // print the character
  }

  delay(250);
}
</code></pre>
<p dir="auto">I have a 4-20mA current source which I can measure, so I am confident I have a variable input.</p>
<p dir="auto">I have not used I2C before, I am confident the Arduino libraries are correct, so any pointers to what it might be would be appreciated.  Thanks.</p>
</blockquote>
<p dir="auto">not sure if you can marry M5stack sensor/module with diff MCUs than esp32? maybe I'm wrong here.</p>
]]></description><link>https://community.m5stack.com/post/27184</link><guid isPermaLink="true">https://community.m5stack.com/post/27184</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Thu, 28 Nov 2024 13:19:38 GMT</pubDate></item></channel></rss>