claudeDroneteam-docs
documentation · reference
Docs reference

Structured knowledge from collected_doc_media/claudedrone_docs/. Browse the tree on the left; the source of truth is markdown in the repo.

TF-Luna driver — overview

Driver overview for the TF-Luna sensor; for the ESP32-S3 implementation see the firmware-specific page.

stabledoc-seoupdated 2026-05-11T00:00:00.000ZClaudeDroneTFLunaDriver

The TF-Luna driver layer is the firmware code that reads the 9-byte UART packets from the sensor, parses them, validates them, and exposes a clean stream of (distance_cm, amplitude, valid) tuples to higher layers.

For the ESP32-S3 implementation details — frame sync via scan-for-magic 0x59 0x59, 512-byte UART buffer, health flag, 7-case host unit-test suite — see TF-Luna driver (firmware). That page covers the architectural pattern, code structure, and the two self-inflicted bugs caught by tests.

High-level interface

struct TFLunaFrame {
  uint16_t distance_cm;
  uint16_t amp_raw;
  float    temp_c;
  bool     valid;
};

bool tf_luna_parse_frame(const uint8_t *buf, TFLunaFrame &out);

Pure C++ functions on top, Arduino-class wrapper underneath the #if defined(ARDUINO) boundary — see host-testable Arduino pattern.

Where to go next

© 2026 claudeDrone Team · auto-pipeline · Nuxt 3 SSR