|
Lamp-Da 0.1
A compact lantern project
|
First clone the repository:
This project uses the Arduino SDK, you will need to install several dependencies before being able to build the project and upload your firmware.
For reference, if you are on a Debian/Linux (debian12,bookworm) system, here is a list of packages that you may need to use this project:
build-essential gcc g++ clang clang-format make cmake git for developmentpython3 python3-venv python-is-python3 to flash the board & use toolslibsfml-dev if you are on a platform that have SFML 2.5.1 or greaterlibx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev, libfreetype-dev libvorbis-dev libflac-dev and libopenal-dev libalut-dev if you do not have SFML2, as the simulator build system will try to download and compile SFML 2.6.1 from source.Depending on your setup (Ubuntu, WSL, Fedora, Archlinux, …) you may need to install other packages, such as arduino-cli or arduino-ide as described below.
You will need to:
arduino-cli is accessible in path$HOME/.arduino15/packages/adafruit/hardware/nrf52 by the content of the above repositoryadafruit-nrfutil from PyPIAdafruit Neopixel and arduinofft librariesTo check that arduino-cli is available in path, you can run:
If your system does not package arduino-cli or if it's not working for you, you may try the following recipe to make it available locally:
Now that arduino-cli is available, if you find yourself in trouble installing the Arduino dependencies by hand, you can use the following to install everything locally:
Once all dependencies are set up, you will be able to build the project as follows:
If you are working on the indexable variant of the lamp, you can use:
When changing lamp type or adding a new file to the sketch, use:
You can also use the clean-artifacts recipe to remove only the output binaries, and to only rebuild what is necessary:
After plugging your board, you should be able to upload as follows:
Note that upload-{simple,cct,indexable} checks that you have build the associated {simple,cct,indexable} recipe, and that you may get an error message if you are mixing up the different versions.
You may need to configure the serial port of the board before uploading:
Once your board is running, to connect to its serial monitor, use:
If you have a virtualenv somewhere with adafruit-nrfutil already installed, you may setup a link to explicitly use it:
To build the documentation, you must have doxygen installed:
You will be able to preview the documentation as follows:
If you want simulate a view of an "indexable mode" animation and have the SFML installed:
This may build the SFML library if SFML 3.0.1 is not available locally, and it will fail if some of the required dependencies are missing.
Note that the compiler used is /usr/bin/c++ by default, and as we are using modern C++17 features as well as things like -fconcepts you will require an up-to-date local compiler – here "up-to-date" typically means something from 2020 :)
There are several clean-* recipes available:
Once you're finished with your work on the project:
Note that this last method WILL remove all the locally installed dependencies, that may be very expensive to install again (more than a gigabyte of setup).