ncmreynolds / ld2410

An Arduino library for the Hi-Link LD2410 24Ghz FMCW radar sensor.
GNU Lesser General Public License v2.1
178 stars 37 forks source link

Won't connect to Mega2560? #7

Closed perigalacticon closed 1 year ago

perigalacticon commented 1 year ago

I used:

  #define MONITOR_SERIAL Serial
  #define RADAR_SERIAL Serial1
  #define RADAR_RX_PIN 18
  #define RADAR_TX_PIN 19

  RADAR_SERIAL.begin(256000);

I get this response:

21:20:49.264 -> Connect LD2410 radar TX to GPIO:18
21:20:49.264 -> Connect LD2410 radar RX to GPIO:19
21:20:49.264 -> LD2410 radar sensor initialising: not connected

With a Mega2560 board. I tried switching Rx & Tx, resetting, & power cycling. Is there any reason it should not connect to the Mega2560?

I had run a control sketch with the same hardware setup with a sketch from DFRobot that worked perfectly from here: https://wiki.dfrobot.com/SKU_SEN0557_24GHz_Human_Presence_Sensing_Module using the same Serial1 definition as I tried with your code which isn't working. I'd like to use your code to be able to update the sensitivities dynamically.

UPDATE: A REALLY SIMPLE FIX. Sorry for the bother! I just had to use the right RADAR_SERIAL.begin(256000); command as there was no option in the defines for "other" boards. Working great now.