Skip to content

Commit

Permalink
Update lds_basic_esp32.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiaai authored Apr 29, 2024
1 parent dd0875e commit 2f1f0da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/lds_basic_esp32/lds_basic_esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ HardwareSerial LdSerial(2); // TX 17, RX 16
LDS_YDLIDAR_X4 lds;

void setup() {
Serial.begin(115200);
Serial.println("LiDAR library example");

lds.setScanPointCallback(lds_scan_point_callback);
lds.setPacketCallback(lds_packet_callback);
lds.setSerialWriteCallback(lds_serial_write_callback);
lds.setSerialReadCallback(lds_serial_read_callback);
lds.setMotorPinCallback(lds_motor_pin_callback);
lds.init();

Serial.begin(115200);
Serial.println(LdSerial.setRxBufferSize(1024)); // must be before .begin()
Serial.print("LDS RX buffer size "); // default 128 hw + 256 sw
uint32_t baud_rate = lds.getSerialBaudRate();
Expand Down

0 comments on commit 2f1f0da

Please sign in to comment.