Aretmis Redboard Serial1 or Serial2 for Benewake TFMini-S Serial communication

Hello,

My first post. Apologies if this is not the correct place to post this topic or not enough information.

I recently purchased the Benewake TFMini-S LIDAR unit and the Sparkfun Redboard Artemis. I am having some trouble getting Serial2 to communicate with the TFMini-s and wanted to know if there was an existing Sketch for communicating between these two devices. I am having issued with the Serial2 in the TFMP_example.ino Sketch.

My main issue seems to be that I can talk fine to the Serial port using the Serial.ino sketch but cannot talk to the TFmini-S on the TX1-RX1 pins on the Redboard Artemis Itried Serial2 and Serial1). I am trying to use HardwareSerial since the Redboard Artemis has two UARTs and not SoftwareSerial.

Thanks

Maybe your issue is this known issue https://github.com/sparkfun/Arduino_Apollo3/issues/349. It is serial1 to use.

Thank you Paulvha. I appreciate your response.

Could you point me to some Sketch that is making use of the RX1/TX1 pins on the Redboard Artemis? I am new to this world and I could be missing something simple.

Thank you again.

void setup()
{
  Serial1.begin(115200);
  Serial.begin(115200);
}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to TX1
    Serial1.write(Serial.read());
  }
  if (Serial1.available())
  { // If data comes in from RX1, send it out to serial monitor
    Serial.write(Serial1.read());
  }
}

Jumper RX1 and TX1 and anything you send at 115200 baud should echo back to you.

Thank you YellowDog. I appreciate it. Can you please let me know what include files to place at the top? I think this might be where I am going wrong.

Thanks again

No include files needed, that code example will work as is.