This project is intended as a starting point for working with the Pico SDK and Pimoroni Libraries in C++.
- Before you start
- Preparing your build environment
- Grab the Pimoroni libraries
- Clone this boilerplate
- Prepare Visual Studio Code
- Prepare your project
- Pick your LICENSE
It's easier if you make a pico
directory or similar in which you keep the SDK, Pimoroni Libraries and your projects alongside each other. This makes it easier to include libraries.
Install build requirements:
sudo apt update
sudo apt install cmake gcc-arm-none-eabi build-essential
And the Pico SDK:
git clone https://github.com/raspberrypi/pico-sdk
cd pico-sdk
git submodule update --init
export PICO_SDK_PATH=`pwd`
cd ../
The PICO_SDK_PATH
set above will only last the duration of your session.
You should should ensure your PICO_SDK_PATH
environment variable is set by ~/.profile
:
export PICO_SDK_PATH="/path/to/pico-sdk"
git clone https://github.com/pimoroni/pimoroni-pico
git clone https://github.com/pimoroni/pico-boilerplate
cd pico-boilerplate
If you have not or don't want to set PICO_SDK_PATH
you can edit .vscode/settings.json
to pass the path directly to CMake.
Open VS Code and hit Ctrl+Shift+P
.
Type Install
and select Extensions: Install Extensions
.
Make sure you install:
- C/C++
- CMake
- CMake Tools
- Cortex-Debug (optional: for debugging via a Picoprobe or Pi GPIO)
- Markdown All in One (recommended: for preparing your own README.md)
Edit CMakeLists.txt
and follow the instructions, you should make sure you:
- edit your project name
- include the libraries you need
- link the libraries to your project
We've included a copy of BSD 3-Clause License to match that used in Raspberry Pi's Pico SDK and Pico Examples. You should review this and check it's appropriate for your project before publishing your code.