<?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[M5core 12 channel Server Module not work.]]></title><description><![CDATA[<p dir="auto">Hi Gents,</p>
<p dir="auto">i have a Problem with my Servo module. I buy the M5Core 12 channel Servo modul, and connect my servo on Port 0 from the Modul, but the Servo not work.</p>
<p dir="auto">I have a running example for the Arduino, which works well with the Servo. I think the problem is my logic to move the code from Arduino Uno to M5Core 12 Channel Servo modul.</p>
<p dir="auto">That is working with Arduino Uno:</p>
<pre><code>#include &lt;SoftwareSerial.h&gt;

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
  Serial.begin(9600);
  mySerial.begin(115200);
  Serial.println("start");
}

void servo(char ServoId, char Mode, char Degrees, char Speed)
{

  // Build checksum;
  int sum = ServoId + Mode + Degrees + Speed;

  char zero = 0;
  while (sum &gt; 255)
  {
    sum -= 255;
  }

  //Head (Preamble)
  mySerial.write(0xFA); // Byte 1: Preamble;
  mySerial.write(0xAF); // Byte 2: Preamble;

  //Data
  mySerial.write(ServoId); // Byte 3: ServoID (See label of servo)
  mySerial.write(Mode);    // Byte 4: Command; for “go to command” we have = 0x01; we will try to find some other commands shortly
  mySerial.write(Degrees); // Byte 5: position = 120 + desired position in degrees;

  mySerial.write(Speed); // Byte 6: duration = duration in ms / 20
  mySerial.write(zero);  // Byte 7: 0x00 (? we don’t know what this is yet)
  mySerial.write(zero);  // Byte 8: 0x01 (? we don’t know what this is yet)

  //Check &amp; End
  mySerial.write(sum);  // checksum = sum(byte 3 through 8) mod 256
  mySerial.write(0xED); // closure = 0xED (from “END”?)
}

void loop()
{
  servo(16, 1, 45, 40);
  delay(2000);

  servo(16, 1, 0, 10);
  delay(2000);
}
</code></pre>
<p dir="auto">And here i try move my code to M5Stack with 12 channel Servo Modul, which are not work on Port 0. Have any a idea ?</p>
<pre><code>#include &lt;Arduino.h&gt;
#include &lt;M5Stack.h&gt;
#include &lt;Wire.h&gt;

#define SERVO_ADDR 0x53
void setup()
{
    M5.begin(true, false, true);
    M5.Power.begin();
    M5.Lcd.setTextFont(4);
    M5.Lcd.setCursor(70, 100);
    M5.Lcd.print("Servo Example");

    Wire.begin(21, 22, 115200);
}

void servo(char ServoId, char Mode, char Degrees, char Speed)
{

    Wire.beginTransmission(SERVO_ADDR);
    Wire.write(0x00);

    // Build checksum;
    int sum = ServoId + Mode + Degrees + Speed;

    char zero = 0;
    while (sum &gt; 255)
    {
        sum -= 255;
    }

    //Head (Preamble)
    Wire.write(0xFA); // Byte 1: Preamble;
    Wire.write(0xAF); // Byte 2: Preamble;
    Wire.write(ServoId); // Byte 3: ServoID (See label of servo)
    Wire.write(Mode);    // Byte 4: Command; for “go to command” we have = 0x01; we will try to find some other commands shortly
    Wire.write(Degrees); // Byte 5: position = 120 + desired position in degrees;
    Wire.write(Speed); // Byte 6: duration = duration in ms / 20
    Wire.write(zero);  // Byte 7: 0x00 (? we don’t know what this is yet)
    Wire.write(zero);  // Byte 8: 0x01 (? we don’t know what this is yet)
    Wire.write(sum);  // checksum = sum(byte 3 through 8) mod 256
    Wire.write(0xED); // closure = 0xED (from “END”?)


    Wire.endTransmission();
}

void loop()
{
    servo(16, 1, 45, 40);
    delay(2000);

    servo(16, 1, 0, 10);
    delay(2000);
}
</code></pre>
<p dir="auto">Can anyone help me, please... ?</p>
]]></description><link>https://community.m5stack.com/topic/2881/m5core-12-channel-server-module-not-work</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 02:45:58 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2881.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Feb 2021 11:13:37 GMT</pubDate><ttl>60</ttl></channel></rss>