How josmeuleman/frlibintegration works
Main Components
• FlightRecorder Logger Component:
• The Logger (FRLogger) – central to aggregating sensor data and writing it to SD.
• Methods such as CheckSD, StartLogger, UpdateSensors, WriteLogger.
• Sensor Abstraction and Implementations:
• The abstract FRSensor class as the parent.
• Concrete sensor classes derived from FRSensor like FRAnalog, FRAS5600, FRBMP280, FRMPU9250, FRMS4525DO, FRTinyGPS, and FRPPMReceiver.
• External and Underlying Dependencies:
• Mention libraries that the project depends on (e.g., FRLibBasics, AS5600, Adafruit_BMP280, MPU9250, TinyGPSPlus-ESP32, etc.).
• Use of Arduino’s I2C (Wire) for sensor initializations.
• Examples / Integration Templates:
• Various example projects (e.g., FRLoggerServoIntegrationTemplate, FRServoControlTemplate, FRTestTwoReceivers) illustrate how the components interact in practice. These examples also showcase different integration patterns like multi-tasking at different frequencies.
Relationships and Interactions
• The FRLogger is at the center – it aggregates sensor objects.
• Each sensor class (child of FRSensor) implements two key methods (HeaderString() for CSV/log file headers and SensorString() for data rows) that feed into the logger.
• Sensors are initialized (many with I2C communication via Wire) and then “registered” with the logger using AddSensor.
• Data/invocation flow from sensor initializations to sensor object creation.
• Registration of sensor objects into logger.
• The logger periodically calls UpdateSensors and WriteLogger, gathering data from each sensor.
• Examples illustrate the top-level “main loop” integration where sensor update functions and servo control processes (which run at differing frequencies) operate concurrently.
Architectural Patterns and Design Principles
• Modular design with separation of concerns: Logger management is separated from sensor data acquisition.
• Inheritance and polymorphism are key: FRSensor acts as the base class from which specialized sensor classes derive behavior.
• External dependency injection: Many sensor classes require external libraries (and even hardware interfaces) to function.
• Example-driven integration: The project provides sample sketches to illustrate proper usage patterns.
Technologies, Frameworks, and Libraries (as important labels
• Arduino IDE environment (and ESP32-specific libraries).
• I2C communication (Wire library).
• External sensor libraries (Adafruit, MPU9250, TinyGPSPlus, etc.).
• SD card logging (via FRLogger).