How use Grove Doppler Radar (BGT24LTR11) on Md

Hello, someone can help me to convert this code in arduino to mbed?

#include “GBT24LTR11.h”

#ifdef AVR
#include <SoftwareSerial.h>
SoftwareSerial SSerial(2, 3); // RX, TX
#define COMSerial SSerial
#define ShowSerial Serial

GBT24LTR11<SoftwareSerial> GBT;

#endif

#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define COMSerial Serial1
#define ShowSerial SerialUSB

GBT24LTR11<Uart> GBT;

#endif

#ifdef ARDUINO_ARCH_STM32F4
#define COMSerial Serial
#define ShowSerial SerialUSB

GBT24LTR11<HardwareSerial> GBT;

#endif

void setup() {
// put your setup code here, to run once:
ShowSerial.begin(9600);
COMSerial.begin(115200);
GBT.init(COMSerial);
while (!ShowSerial)
;
while (!COMSerial)
;
/*
MODE 0 -->detection target mode
MODE 1 -->I/Q ADC mode
*/
while (!GBT.setMode(0))
;
}

void loop() {
// put your main code here, to run repeatedly:
uint16_t state = 0;
ShowSerial.print(“target speed:”);
ShowSerial.println(GBT.getSpeed());
state = GBT.getTargetState();
//2 → target approach
//1 → target leave
//0 → Not Found target
if (state == 2) {
ShowSerial.println(“target approach”);
} else if (state == 1) {
ShowSerial.println(“target leave”);
}
delay(200);
}

hi @ghost05,

what issues are you facing? can you post compiler errors and maybe use the “preformated text” for your sourcecode so its readable?

Also, since the wiki only references the library in version 1.0.0, id suggest to get the latest version from GitHub: Releases · Seeed-Studio/Seeed_Arduino_DopplerRadar · GitHub