<?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[M5stack core2 control 12 channel Servo module]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm using M5stack core2 and 12 channel  servo module (<a href="https://docs.m5stack.com/en/module/servo" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/en/module/servo</a>) to control servo motors.</p>
<p dir="auto">I plug the servo module onto the m5stack core2 and use the code (<a href="https://github.com/m5stack/M5Core2/blob/master/examples/Module/SERVO/SERVO.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Core2/blob/master/examples/Module/SERVO/SERVO.ino</a>)</p>
<p dir="auto">but the servo motor, does not work properly, the motor works fine with other drivers.</p>
<p dir="auto">I guess there might be some problem with the code.</p>
<p dir="auto">could you please help to check if the M5stack core2 could work with the Servo module?</p>
<p dir="auto">thank you.</p>
]]></description><link>https://community.m5stack.com/topic/4835/m5stack-core2-control-12-channel-servo-module</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 00:09:18 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4835.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Nov 2022 18:15:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Tue, 29 Nov 2022 12:45:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lishengkkk" aria-label="Profile: lishengkkk">@<bdi>lishengkkk</bdi></a></p>
<p dir="auto"><img src="/assets/uploads/files/1669725914814-fbaad8a0-e3c8-43d4-8534-c63e11b13031-image-resized.png" alt="0_1669725911615_fbaad8a0-e3c8-43d4-8534-c63e11b13031-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/19408</link><guid isPermaLink="true">https://community.m5stack.com/post/19408</guid><dc:creator><![CDATA[LishengKKK]]></dc:creator><pubDate>Tue, 29 Nov 2022 12:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Tue, 29 Nov 2022 12:44:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a></p>
<p dir="auto">Meanwhile, I got a reply from the 'support@m5stack.com'</p>
<p dir="auto">they provided another solution.....</p>
<p dir="auto">in the M5stack core2 library (~/Arduino/libraries/M5Core2/src),<br />
in the class  'void M5Core2::begin'<br />
change<br />
'  // I2C init<br />
if (I2CEnable == true) {<br />
Wire.begin(32, 33);<br />
}'</p>
<p dir="auto">to<br />
'  // I2C init<br />
if (I2CEnable == true) {<br />
Wire.begin(21, 22, 100000UL);<br />
}'<br />
then in the arduino code:<br />
add 'Wire.begin(22, 21);'</p>
<p dir="auto">then the core2 and 12-channel servo will work properly.</p>
<p dir="auto">but the weird thing is that they still work even when I delete the line 'Wire.begin(21,22);'  meaning delete all the 'Wire.begin(..,..);' in the void setup() .</p>
<p dir="auto">this is a bit funny.</p>
]]></description><link>https://community.m5stack.com/post/19407</link><guid isPermaLink="true">https://community.m5stack.com/post/19407</guid><dc:creator><![CDATA[LishengKKK]]></dc:creator><pubDate>Tue, 29 Nov 2022 12:44:41 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Mon, 28 Nov 2022 19:13:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lishengkkk" aria-label="Profile: LishengKKK">@<bdi>LishengKKK</bdi></a></p>
<p dir="auto">cool. I am happy to hear you got it working. Thank you for reporting back.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/19401</link><guid isPermaLink="true">https://community.m5stack.com/post/19401</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 28 Nov 2022 19:13:31 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Mon, 28 Nov 2022 18:33:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a><br />
thank you very much, follow your tips, now the M5stack cores can work with the 12-channel servo.</p>
]]></description><link>https://community.m5stack.com/post/19400</link><guid isPermaLink="true">https://community.m5stack.com/post/19400</guid><dc:creator><![CDATA[LishengKKK]]></dc:creator><pubDate>Mon, 28 Nov 2022 18:33:25 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 22:57:01 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/teastain" aria-label="Profile: teastain">@<bdi>teastain</bdi></a></p>
<p dir="auto"><code>Wire.begin()</code> used to always initialize an I2C <strong>master</strong>, but in recent ESP32 Arduino framework versions an ESP32 can also be setup as I2C <strong>slave</strong>. But instead of creating a new function like <code>Wire.beginSlave()</code> it has been decided to <a href="https://en.wikipedia.org/wiki/Function_overloading" target="_blank" rel="noopener noreferrer nofollow ugc">overload</a> the already existing <code>begin()</code> function so it can be used to initialize an I2C master or a slave.</p>
<p dir="auto">The compiler / linker decides from the argument types which begin function to call. The I2C master begin function is defined like this:</p>
<pre><code>bool begin(int sda, int scl, uint32_t frequency=0);
</code></pre>
<p dir="auto">And the I2C slave begin function is defined like this:</p>
<pre><code>bool begin(uint8_t slaveAddr, int sda, int scl, uint32_t frequency);
</code></pre>
<p dir="auto">Now if you call <code>Wire.begin(SDA, SCK)</code> and <code>SDA</code> and <code>SCK</code> are defined as <code>uint8_t</code> the I2C slave begin is called (instead of the intended I2C master begin) since the argument types match better.</p>
<p dir="auto">Thanks<br />
Felix</p>
<p dir="auto">P.S.: my original advise to typecast the arguments to <code>(int)</code> was useless as numbers are already defined as <code>int</code>.</p>
]]></description><link>https://community.m5stack.com/post/19376</link><guid isPermaLink="true">https://community.m5stack.com/post/19376</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 24 Nov 2022 22:57:01 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 22:44:13 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lishengkkk" aria-label="Profile: LishengKKK">@<bdi>LishengKKK</bdi></a></p>
<p dir="auto">please try this - leave <code>Wire.begin()</code> as it is but replace <code>Wire</code> with <code>Wire1</code> in the two functions <code>Servo_write_us90()</code> and <code>Servo_write_angle()</code>.</p>
<p dir="auto">Explanation: M5Core2 uses <code>Wire1</code> for the internal I2C and <code>Wire</code> for the external I2C (Groove port). <code>Wire1</code> is initialized in <code>M5.begin()</code> and used for the touch screen.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/19375</link><guid isPermaLink="true">https://community.m5stack.com/post/19375</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 24 Nov 2022 22:44:13 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 20:10:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a></p>
<p dir="auto">thanks a lot, but I still can not fix the problem, now I change to use another controller instead of core2.</p>
]]></description><link>https://community.m5stack.com/post/19374</link><guid isPermaLink="true">https://community.m5stack.com/post/19374</guid><dc:creator><![CDATA[LishengKKK]]></dc:creator><pubDate>Thu, 24 Nov 2022 20:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 16:08:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hi, I see a number of posts where the fix is adding (int) twice in the function’s parameters.<br />
It seems the parameters are already correct, can you help me understand what difference this makes?<br />
-thanks, Terry</p>
]]></description><link>https://community.m5stack.com/post/19372</link><guid isPermaLink="true">https://community.m5stack.com/post/19372</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Thu, 24 Nov 2022 16:08:22 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 10:06:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lishengkkk" aria-label="Profile: LishengKKK">@<bdi>LishengKKK</bdi></a></p>
<p dir="auto">my suggestion is based on other examples using I2C where the original code would initialize an I2C slave instead of an I2C master due to some recent changes in the ESP32 Arduino framework.</p>
<p dir="auto">I am sorry, but I don't have working code to share as I don't have the necessary hardware to test (e.g. I don't have a Servo module). Sorry.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/19368</link><guid isPermaLink="true">https://community.m5stack.com/post/19368</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 24 Nov 2022 10:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Thu, 24 Nov 2022 08:58:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>   thank you.</p>
<p dir="auto">I changed the code as you suggested, but the servo still doesn't work.</p>
<p dir="auto">could you please share the code which works well on your side?</p>
<p dir="auto">thanks again.</p>
]]></description><link>https://community.m5stack.com/post/19367</link><guid isPermaLink="true">https://community.m5stack.com/post/19367</guid><dc:creator><![CDATA[LishengKKK]]></dc:creator><pubDate>Thu, 24 Nov 2022 08:58:00 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack core2 control 12 channel Servo module on Wed, 23 Nov 2022 20:11:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lishengkkk" aria-label="Profile: LishengKKK">@<bdi>LishengKKK</bdi></a></p>
<p dir="auto">try changing this line:</p>
<pre><code>Wire.begin(32, 33, 100000UL);
</code></pre>
<p dir="auto">to:</p>
<pre><code>Wire.begin((int) 32, (int) 33, 100000UL);
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/19363</link><guid isPermaLink="true">https://community.m5stack.com/post/19363</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 23 Nov 2022 20:11:43 GMT</pubDate></item></channel></rss>