Go Down

Topic: HardwareSerial TFMini (Read 296 times) previous topic - next topic

Soerili

Hi guys,

I want to know, how the HardwareSerial library functions for the DUE.
With other boards i can initialize it normally via
Code: [Select]
HardwareSerial mySerial(2)
 for example, but the <HardwareSerial.h> doesn't have a constructor.

I want to use the TFMini library. In the example a SoftwareSerial is initialized, but for DUE there doesn't seem to be a SoftwareSerial library.

How can I use this for the DUE?

Code: [Select]
#include <SoftwareSerial.h>
#include "TFMini.h"

// Setup software serial port
SoftwareSerial mySerial(10, 11);
TFMini tfmini;


Idahowalker

I used a Due with a TFMini.

In the declaration section:
#include "TFMini.h"

TFMini tfmini;

In the setup:

  Serial1.begin(TFMINI_BAUDRATE);
  // Initialize the TFMini LIDAR
  tfmini.begin(&Serial1);
  // Initialize single measurement mode with external trigger
  tfmini.setSingleScanMode();

Go Up