Skip to content
/ pico-w-template Public template

Template repository for C/C++ Pico W project using pico-sdk and pico-extras with support for networking and multithreading. Functional workflows for CI and Doxygen docs deployment to GitHub Pages and CodeQL code scan included.

License

Notifications You must be signed in to change notification settings

milosz275/pico-w-template

Repository files navigation

Pico W Template

CMake Build Workflow CodeQL with CMake Build Doxygen Pages License

logo

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.

use template screen

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.

github pages

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.

About

Template repository for C/C++ Pico W project using pico-sdk and pico-extras with support for networking and multithreading. Functional workflows for CI and Doxygen docs deployment to GitHub Pages and CodeQL code scan included.

Topics

Resources

License

Stars

Watchers

Forks