Our project uses the PlatformIO extension for Visualt Studio Code to compile and run code on embedded devices. This project can also be run on both Windows and Linux by following the desktop setup instructions.
For information about running the distribution version of the code, see the distribution documentation.
Our project is currently configured to run on the Arduino Mega, Due, and a custom board using the Arduino framework. If you have an Arduino board, the setup should be quite similar. Please see the PlatformIO Docs for information on adding another board to the project configuration file. PlatformIO has an extensive list of boards which are already supported.
The project includes files for interacting with an SD card on Arduino boards, and a wrapper for the Ardunio serial output library to define a custom printf()
function. For an how to setup a main C file for Ardunio using these libraries, see dueMain in the source folder. Please note that if you add another main file to the source folder, you must modify the build_src_filter
option in the configuration file to exclude the main files for the other boards configured in this project.
Once your board is configured with a main file, you can run the included example file by calling the embedDBExample()
function from your main file. This file configures an instance of EmbedDB, and performs some basic functions with the database. To run the main file and example, please select the PlatformIO tab in the sidebar. Then, select the board you want to run the code on under the project tasks menu. For the Arduino Due, you would select due > General > Upload and Monitor. This will compile the code, upload it to your board, and monitor the serial connection for output during the runtime.
In order to run the unit tests for this project on a different board, you will need to implement a custom test setup file. Please see the due test setup file for an example.
Once you have a custom setup file, you can run the unit tests through the Advanced tab under the board you configured. For example, to run unit tests on the Arduino Due, select due > Advanced > Test.