This is the codebase for Caltech's 2022 Big Idea Challenge Proposal LATTICE.
To support a more expansive set of files, the PlatformIO will be used. It supports several IDE's (e.g. having an extension for VSCode) which makes installation simple.
To support the running of multiple files and unit testing, the setup is slightly less straightforward than pressing the build or deploy buttons. The Platform IO commandline will have to be used.
To setup a new main file, go to platformio.ini
and then copy the [env:example]
environment and the line below it rename it to what the main file will be testing/running e.g. [env:encodertest]
. The resulting code addition should be something like:
[env:envname]
extends = env:due
Then you can make a main file in the following naming format: main-envname.cpp
.
Run: pio run -e envname
Run: pio run -t upload -e envname
Run: pio device monitor -e envname
Run: pio test -e native
This requires gcc to be installed. Follow these instructions to get that setup. Note that we won't be able to support actual hardware unit tests without alot more work so only write unit tests for non-hardware dependent things like math functions.
Run: pio init --ide vscode
VSCode Supports code formatting through the C++ extension. You can run it on a file with Shit-Alt-F
. You can even configure it to format on file save. Note that you probably want to configure the formatter to use the Google Standard as denoted in this stack-overflow post.