How dannyravi/ad7747 works
Main Components
• Hardware Device: The AD7747 sensor is the physical component providing capacitive measurements. Note from the README that it operates at either 3.3V or 5V and communicates via I2C.
• Arduino Board: The library is designed to be used on Arduino platforms. The board (with its SDA, SCL, and optionally RDY lines) acts as an intermediary between the sensor and user code.
• AD7747 Arduino Library: The core of your project is contained in the src directory (AD7747.cpp and AD7747.h) and provides the API for initializing the sensor, reading data, and handling sensor configuration.
• Example Sketches: Located in the examples folder, these demonstrate how to incorporate and use the library on an Arduino board, showing the initialization of the Wire library, sensor connection checks, and data acquisition.
• Build & CI Tools: The .github directory (with workflows such as c-cpp.yml) indicates that continuous integration (CI) is set up to ensure code quality and build stability.
• Metadata & Configuration Files: Files like library.properties and LICENSE define the library metadata and open-source licensing.
Relationships and Interactions
• The AD7747 Arduino Library abstracts this hardware interaction, offering functions (e.g., isDeviceConnected, loadSettings, getCap) that the user calls.
• Example sketches serve as the client code demonstrating the usage; they include the library header and illustrate initialization (via Wire.begin()) and sensor data retrieval.
• The CI pipeline (represented by the GitHub workflow) continuously tests and validates the library, ensuring any changes maintain compatibility with the sensor and Arduino environment.
Architectural Patterns and Design Principles
• Abstraction: The library abstracts the sensor details so that developers do not need to directly manage low-level I2C transactions.
• Modularity: Separation between the library code (src), usage examples (examples), and build scripts (.github) ensures the project remains maintainable and extensible.
• Hardware–Software Integration: Clear separation between hardware components (AD7747 sensor, Arduino board) and the software layer (library API, example code).
Incorporate Relevant Technologies, Frameworks, and Libraries
• Arduino / C++: The whole library is written in C++ for the Arduino environment.
• I2C Communication: Utilization of the Wire library in Arduino for I2C connectivity.
• CI/CD Tools: GitHub Actions as shown in the .github/workflows/c-cpp.yml file.
• Visualization Tools: The README mentions ArduinoSerialPlot as a recommended tool for visualizing sensor output in real time.
Final Detailed Reminder
• Don’t be afraid to break down the system into as many functional components as possible so that the overall data flows and dependencies are very clear.