Skip to main content

Setup

Arduino

Install the following:

  1. Arduino v2.x or newer. Please follow the installation instructions for your OS.

  2. Arduino ESP32 v2.0.15 or newer. Please follow the installation guide from Espressif.

    Adding Boards Manager URL

    Installing ESP32-S3 PowerFeather board support

  3. PowerFeather-SDK 1.0.0 or newer. Follow the instructions for installing a library.

    Installing PowerFeather-SDK

To test if setup was done properly, create a sketch with the following content:

#include <PowerFeather.h>

using namespace PowerFeather;

void setup()
{
Board.init();
}

void loop()
{
}

The above is the minimal sketch code for PowerFeather, which just initializes the board hardware. Build the sketch, it should proceed without any errors.

Building Arduino minimal sketch

ESP-IDF

ESP-IDF needs to be installed first. PowerFeather-SDK requires ESP-IDF v4.4 or newer. Please follow the installation guide for Windows or Linux and macOS.

To demonstrate adding PowerFeather-SDK to an ESP-IDF project, we'll create a sample one. Open a terminal with the ESP-IDF environment loaded on Windows or Linux and macOS. Navigate to a directory where the sample ESP-IDF project can be created, and run the command:

idf.py create-project "powerfeather_project"

Creating ESP-IDF sample project

Navigate into the created sample ESP-IDF project directory. Rename main/powerfeather_project.c to main/powerfeather_project.cpp. Your project tree should look like the following:

Renaming main C file

Edit main/CMakeLists.txt and change powerfeather_project.c to powerfeather_project.cpp, to reflect the rename done in the previous step.

Editing CMakeLists.txt

Replace the contents of main/main.cpp with the following:

#include <PowerFeather.h>

using namespace PowerFeather;

extern "C" void app_main()
{
Board.init();
}

The above is the minimal ESP-IDF project code for PowerFeather, which just initializes the board hardware.

Editing main CPP

To add PowerFeather-SDK as a component for the sample ESP-IDF project, run the command:

idf.py add-dependency "powerfeather/powerfeather-sdk^1.0.0"

Adding PowerFeather-SDK dependency

Build the sample ESP-IDF project by issuing the commands:

idf.py set-target esp32s3
idf.py build

If everything was set up correctly, the build should proceed without any compilation errors.

Building ESP-IDF sample project