LiDAR
One turn and the space is drawn
Page 35 drives an LD06 / LD19 class spinning lidar over Serial2 (39 = RX / 38 = TX at 230400), which leaves 43/44 free — so it can run alongside GNSS and SMS.
Frames are a fixed 47 bytes: 0x54 start, 0x2C meaning twelve points follow, then speed, start and end angle, timestamp, CRC8 and twelve "distance + confidence" pairs. Two things must be handled when drawing: crossing 0° makes the end angle smaller than the start angle, so the span needs +360° or a wedge is misplaced every time the sweep passes straight ahead; and every point needs a 1.5-second expiry, otherwise dozens of revolutions smear into a blob. Redraw is capped at 6 Hz, but serial capture must never be throttled or the buffer overflows and frames are dropped.
On-screen interface
A recreation of this page on the 2.41-inch AMOLED display (600 × 450). Actual interaction and layout follow the latest firmware.
Key capabilities
12 points per frame
Fixed 47-byte frames, speed and angles included.
0° wrap fixed
end < start adds 360° so straight ahead has no seam.
1.5 s expiry
Old points fade out instead of smearing.
Unthrottled capture
Only the redraw is limited, so no frames are lost.
Technical specs
Typical scenarios
Room outline
One revolution shows the room size and where the furniture is.
Obstacle range
Take the nearest distance straight ahead for simple avoidance.
Related commands
page 35 Open the LiDAR page lidar Speed, point count and nearest distance lidar range 12 Only draw points within 12 m lidar sim on Inject a synthetic cloud (flagged red on screen) lidar clr Clear the current cloud lidar rx <hex> Feed one raw frame through the real parser
- Needs 5 V: on 3V3 the motor bogs down and it looks like "connected but no data".
- Glass, mirrors and matte black surfaces give bad ranges — a physical limit of the sensor.
- Exclusive with the logic analyser, which needs the same high-speed sampling.