Need help with sending commands to Arduino

I try to send a command to the Arduino to turn a servo motor. I enter the command in CAN MONITOR, the motor turns, but when I send the command through a virtual button, nothing happens. I am uploading my codes please help me with this thing
Simple command

0x0c80:0x0 0x32

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

#define SERVOMIN  125
#define SERVOMAX  625

void setup() {
  Serial.begin(9600);
  pwm.begin();
  pwm.setPWMFreq(60);
}

void loop() {
  if (Serial.available() >= 12) {  // 4 bytes for serialBlockTag, 4 bytes for canFrameId, 8 bytes for frameData
    byte serialBlockTag[4];
    Serial.readBytes(serialBlockTag, 4);

    if (serialBlockTag[0] == 0x44 && serialBlockTag[1] == 0x33 && serialBlockTag[2] == 0x22 && serialBlockTag[3] == 0x11) {
      unsigned long canFrameId;
      Serial.readBytes((char*)&canFrameId, 4);

      if (canFrameId == 0x0c80) {
        byte frameData[8];
        Serial.readBytes(frameData, 8);

        int combinedValue = (frameData[0] << 8) | frameData[1]; 
        int servoNum = (combinedValue >> 8) & 0xFF;
        int angle = combinedValue & 0xFF;

        if (servoNum >= 0 && servoNum < 16 && angle >= 0 && angle <= 180) {
          int pulseLength = map(angle, 0, 180, SERVOMIN, SERVOMAX);
          pwm.setPWM(servoNum, 0, pulseLength);
          Serial.print("Servo ");
          Serial.print(servoNum);
          Serial.print(" angle: ");
          Serial.println(angle);
        } else {
          Serial.println("Invalid servo number or angle.");
        }
      } else {
        Serial.println("Invalid CAN frame ID.");
      }
    } else {
      Serial.println("Invalid serial block tag.");
    }
  }
}
<RealDashCAN version="2">

<frames baseId="3200">

<frame id="3200" writeInterval="1000">

<value name="CombinedValue" units="bit" offset="0" length="1"/>

<value name="ServoNum" units="bit" offset="0" length="1"/>

<value name="Angle" units="bit" offset="0" length="1"/>

</frame>

</frames>

</RealDashCAN>

Is there no one here who can help?
Even the developers. I got the solution in the Arduino forum
But I was left with a delay problem, sometimes it takes three or four clicks on the button for the code to work

Its difficult to help on this sort of projects over the forum. There is so many ‘moving parts’, so you have to be realistic on amount of help you will receive.

Only thing I can see from your XML is that you use baseId=“3200” and frame id=“3200” which probably is not what you want.

Please help me I have written all the code for this from the serial monitor all works
what am i missing in here i can see the frame on can monitor

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// Create an object for PCA9685
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

#define SERVOMIN  150 // Minimum pulse length
#define SERVOMAX  600 // Maximum pulse length

void setup() {
  Serial.begin(9600); // Set Serial baud rate to 9600
  Serial.println("Starting PCA9685");

  pwm.begin();
  pwm.setPWMFreq(60);  // Set frequency to 60Hz
}

int angleToPulse(int angle) {
  return map(angle, 0, 180, SERVOMIN, SERVOMAX);
}

void loop() {
  if (Serial.available() >= 4) { // Check if there are at least 4 bytes available in Serial
    int CMDSERVO[2]; // Array for two values
    CMDSERVO[0] = Serial.parseInt(); // Servo number
    CMDSERVO[1] = Serial.parseInt(); // Angle

    int servoNum = CMDSERVO[0];
    int angle = CMDSERVO[1];

    if (servoNum >= 0 && servoNum <= 15 && angle >= 0 && angle <= 180) {
      int pulseLength = angleToPulse(angle);
      pwm.setPWM(servoNum, 0, pulseLength);
      Serial.print("Servo ");
      Serial.print(servoNum);
      Serial.print(" set to angle ");
      Serial.print(angle);
      Serial.print(" (pulse: ");
      Serial.print(pulseLength);
      Serial.println(")");
    } else {
      Serial.println("Invalid values. Try again.");
    }
  }
}
<RealDashCAN version="2">

<frames>

<frame id="3200" writeInterval="1000">

<value name="CMDSERVO" units="byte" offset="0" length="2"/>

</frame>

</frames>

</RealDashCAN>

I don’t see any code that is sending or receiving the CAN frames. I get a feeling that you are just throwing code/xml around without understanding what you are doing.

See our Arduino examples and try to understand how CAN frames are sent/received from Arduino device. Also, consider asking for a friend or colleague to sit with you for a day to get the basics right.

RealDash-extras/RealDash-CAN/Arduino-examples at master · janimm/RealDash-extras · GitHub

Thank you very much for your patience, in the end I was able to write a code, a command is accepted and the servos move, only there is a serious delay, I connected Serial Debug with another Arduino board and I see that the board receives frames from REALDASH without sending a command. The message that is received is

i received can frame id

every second

That in your XML is causing that. You can remove the writeInterval, as when you change values in RealDash with Actions, the frames should be written automatically as soon as data changes.