| title | Development Setup |
|---|---|
| sidebarTitle | Development Setup |
| description | Everything you need to go from a fresh machine to building Pocketbyte apps. |
This guide walks you through setting up your Pocketbyte development environment, adding the library component, and running your first application on the device in a few steps.
Before you begin, make sure you have the following:
- A Pocketbyte DevKit
- A USB-C cable
- A Windows, macOS, or Linux computer
```bash
. $HOME/esp/esp-idf/export.sh
```
Verify the installation by checking the version:
```bash
idf.py --version
```
You should see output similar to `ESP-IDF v5.5.1`. If you see an error, make sure the environment is sourced correctly before continuing.
<Tip>
VSCode has an official ESP-IDF extension that will install everything you need automatically. If the install process above is too complicated for you, just install this extension instead! After installing the extension, can use the ESP-IDF even without VSCode.
</Tip>
<Note>
If you are on Windows, you can directly proceed with this step using WSL 2. If you do not want to use WSL2, your best option is to use the VSCode extension.
</Note>
```bash
idf.py create-project my-pocketbyte-app
cd my-pocketbyte-app
```
Set the build target to the ESP32-S3 so that the toolchain and configuration defaults match your Pocketbyte hardware:
```bash
idf.py set-target esp32s3
```
```bash
idf.py add-dependency "omrawaley/pocketbyte"
```
You'll see the component listed in `main/idf_component.yml` after this command completes. The library source is downloaded automatically during the next build.
```c
#include <pocketbyte.h>
void app_main(void)
{
return 0;
}
```
```bash
idf.py build && idf.py flash
```
The device will reset after flashing and your app will start running immediately.
<Tip>
If the flash command times out waiting for the device to enter download mode, hold the **BOOT** button on Pocketbyte, then press and release the **RESET** button while keeping BOOT held, then release BOOT. The device will enter flash mode and the command will proceed.
</Tip>
<Tip>
Use `idf.py monitor` at any time to reconnect to the serial output of an already-flashed device. This is useful for reading debug output from `printf` statements in your app without reflashing. Press `Ctrl+]` to exit the monitor.
</Tip>