SparkFun Forums 

Where electronics enthusiasts find answers.

Topics pertaining to the Arduino Core & software used with the Artemis module and Artemis development boards.
#223761
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
#223785
Code: Select all
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.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum