Pure Data: Carriage return in serial communication?

Hello. I'm trying to send serial data from Pure Data to an Arduino Uno board using the [comport] object.

The code takes the incoming string in the format int,int and ends the string at a carriage return. I can do this just fine using Arduino's own serial monitor, but sending messages from Pure Data doesn't do anything. I assume it's because the messages from Pure Data doesn't actually end with a carriage return, they're just message boxes being banged, ex. [3,58].

How do I end a Pd message with a carriage return? Pd doesn't allow for the use of '' so I assume I would have to add it using some sort of ascii formatting. Any ideas?

It now occurs to me that I could also adjust the code to parse the string at something other than a carriage return. Though I'd like to see if I can pull it off this way.

Also, it seems I cannot send data to the [comport] object AND use Arduino's serial monitor at the same time, so I can't even sniff out what it might actually be received.

The code:

void setup()
{
  Serial.begin(9600);
  
}

String command;

void loop()
{
 if (Serial.available() > 0)
 {
  char c = Serial.read();
 
  if(c == '\n')
  {
    parseCommand(command);
    command = "";
  }
  else
  {
    command += c;
  }
 }
}

void parseCommand(String com)
{
  String part1;
  String part2;

  //int SPACE int
  part1 = com.substring(0, com.indexOf(","));
  part2 = com.substring(com.indexOf(",") + 1);

  int pin = part1.toInt();
  int pwmval = part2.toInt();

  analogWrite(pin, pwmval);

}

I'm very, very much still learning and the early phases of experimentation, so if anything sounds and looks off, please say so.

(deleted)

That is true, though I would think that someone browsing this "interfacing" part of the this forum might have the knowledge on serial connection between Pd and Arduino. But you're right, I'll go ask them as well.

(deleted)

This seems to be the same project as in your other Thread. Please don't double post it just wastes everyone's time.

I am suggesting to the Moderator to merge them.

...R