PicoWTemplate 1.0.0
PicoWTemplate Brief Description
Pico W Template

CMake Build Workflow CodeQL with CMake Build Doxygen Pages License

This is a template for a Pico W project. It includes a basic project structure and a simple example of a Pico W application in C using pico-sdk and pico-extras. Feel free to use it if CMake is is challenging for you or you just want to get started quickly.

Table of Contents

Getting Started

To use this template click "Use this template" and create a new repository or open the template in a codespaces or use this template here.

After the repository is recreated, please modify repo settings in order to GitHub Pages docs deploy workflow succeed. Select GitHub Actions as a source for build and deployment.

[!IMPORTANT] Even if your repository is private, deployed docs will be available publicly.

CodeQL might not work for private repositories. If you want to use it, you need to enable it in the repository settings, else remove the workflow.

Prerequisites

It might be necessary to install additional dependencies to build the project. The following commands install the required dependencies on Ubuntu:

sudo apt-get install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential ninja-build

This project uses git submodules to include the Pico SDK and Pico Extras. To clone the repository with submodules use the following command:

git clone --recurse-submodules https://github.com/{your_username}/{your_repo}.git

If you have already cloned the repository without submodules you can initialize them using the following commands:

git submodule update --init

If any issues occur during the build, you may wanted to update the submodules inside pico-sdk:

cd lib/pico-sdk
git submodule update --init

Configuration

Please create a wifi_credentials.h file inside include directory. The file should contain the following lines:

#ifndef _WIFI_CREDENTIALS_H
#define _WIFI_CREDENTIALS_H
#define WIFI_SSID "wifi_ssid"
#define WIFI_PASSWORD "wifi_password"
#endif

Building

To build the project, run the following commands:

mkdir build
cd build
cmake -G Ninja ..
ninja

This will produce .uf2 file located in build/src directory. You can flash it to your Pico W device using the USB mass storage mode. Instruction

Acknowledgements

License

This project is licensed under the MIT License - see the LICENSE file for details.