FlatBuffers
FlatBuffers is a cross-platform serialization library from Google. The library supports many different programming languages, so it is possible to use it on any platform. Another interesting feature of FlatBuffers is that it can directly map binary data to its representation on the platform it runs without parsing or using extra buffers. As a result, the library is quite efficient in terms of both memory usage and processing power.
The library has great documentation here: https://google.github.io/flatbuffers/
In the FlatBuffers example, we will collect analog data from an LDR and convert the data to binary format (serialization) by using the FlatBuffers library. Moreover, we will again employ the library to revert the binary data to the programming structures (deserialization).
The hardware components of the project are:
- ESP32-S3 Box Lite
- An LDR
- A pull-up resistor (10K)
The following is a Fritzing sketch that shows the connections...