Welcome to Pico projects for C and C++ using CMake and the pico-sdk.
Happy coding!
To get started with the devcontainer for pico-projects
, follow these steps:
- Clone the Repository
git clone https://github.com/PicoNexus/pico-projects.git
- Open in VS Code
Open the cloned pico-projects repository in Visual Studio Code.
- Open in Devcontainer
Use the VS Code command palette (Ctrl+Shift+P) and select Remote-Containers: Open Folder in Container.... Choose the pico-projects folder.
- Build the Container
The first time you do this, the container will be built, which may take a few minutes.
- Running Scripts
Once the container is built and running, open a terminal in VS Code (either Bash or Zsh) and run the build script:
./build.sh
There are a few other scripts available:
- clean.sh
- build-gcc.sh
- run.sh
These scripts will be documented soon.
Note: checkout.sh runs automatically when the container is created, so you don't need to run it manually.
Using Linux or WSL2 will make your experience much more enjoyable.
git clone https://github.com/raspberrypi/pico-sdk.git
Here's an example for Linux/WSL2:
export PICO_SDK_PATH=/home/pawel/src/32bitmicro/PicoNexus/pico-sdk
Check out Quick-start your own project to get things rolling.
git clone https://github.com/PicoNexus/pico-projects.git
Now you're all set to dive into your Pico projects.
Open a command line and navigate to the pico-projects folder:
cd ~/src/32bitmicro/PicoNexus/pico-projects
mkdir build
cd build
cmake ..
For reference, see the log of cmake configuring projects
cmake build .
For reference, see the log of cmake building projects
If CMake configuration fails like this: For reference, see the log of cmake failing to configure, you need to update the submodules in the pico-sdk folder:
cd ~/src/32bitmicro/PicoNexus/pico-sdk
git submodule update --init
For reference, see the log of git updating sub-modules
Once updated, return to the Configuration Step and try again.