Platform IO
UNIHIKER K10 with Platform IO¶
PlatformIO is a cross-platform, cross-architecture, multiple framework, professional tool for embedded systems engineers and for software developers who write applications for embedded products. In this tutorial, we will guide you through the entire process of downloading, installing, and configuring PlatformIO on your computer.

Download Code Editor¶
Platform IO is typically installed via code editor/IDE like CLion or VSCode. This tutorial will introduce how to configure Platform IO in these two IDEs. If you are using another IDE, please refer to this document to learn how to configure Platform IO in your IDE.
| Download | |
|---|---|
| CLion | Download |
| VSCode | Download |
Note
The following configuration needs to be performed only once. Once the Platform IO SDK for K10 is successfully configured, you can directly find DFRobot->Unihiker K10 in Platform IO IDE when creating new projects.
Install Platform IO extension/plug-in¶
Platform IO in CLion¶
CLion is a cross-platform C/C++ IDE for GNU Linux, macOS, and Windows. CLion includes such features as a smart editor, code generation, code quality assurance, automated refactorings, on-the-fly code analysis, project manager, integrated version control systems and debugger.
Refer to the CLion Documentation page for more detailed information.
Note
Step 1 is a temporary step and depends on CLion #CPP-19412: Automatically install PlatformIO Core. You may also skip Step 1 and proceed from Step 2 to install the Platform IO IDE and CLion.
About Unihiker K10: The Unihiker K10 cannot currently be selected directly in Platform IO. You must first create a Platform IO project using another random DFRobot board, then modify the platformio.ini file and download the SDK before you can begin development.
Other plug-in: It is also recommend to install Ini plugin that provides syntax highlighting, formatting, code folding, and viewing structure for โplatformio.iniโ (Project Configuration File).
-
Install PlatformIO Core (CLI). See Installation guide.
-
Download, install and open CLion IDE
-
Install official PlatformIO for CLion plugin.
Open File > Settings.. > Plugins and go to the "Marketplace" tab. Search forPlatformIOand click the "Install" button.
-
Restart CLion IDE after the plug-in is successfully installed.
-
Setting Up the Project
-
Please open โNew Projectโ wizard, select board and framework, and create a new PlatformIO project. Please USE ONLY Latin characters (a-z) in a project name to avoid further issues with project compilation. Numbers and some symbols are allowed depending on different OS:

-
Open
platformio.inifile, then copy and paste the following configure text in it. And usectrl+shot key to save the configure file.
Wait for the SDK download.
-
-
Run test code on Unihiker K10
- Once the SDK download complete, then the Platform IO in CLion is ready to go.
- Open
main.cppfile fromsrcfolder and replace its contents with the next:
Hello Unihiker#include "unihiker_k10.h" UNIHIKER_K10 k10; uint8_t screen_dir = 2; void setup() { k10.begin(); k10.initScreen(screen_dir); k10.creatCanvas(); k10.setScreenBackground(0xFFFFFF); k10.canvas->canvasText("UNIHIKER", 1, 0x0000FF); k10.canvas->updateCanvas(); delay(1000); k10.canvas->canvasText("UNIHIKER", 2, 0xFF0000); k10.canvas->updateCanvas(); delay(1000); k10.canvas->canvasText("UNIHIKER", 3, 0x00FF00); k10.canvas->updateCanvas(); delay(1000); k10.canvas->canvasText("UNIHIKER", 4, 0x000000); k10.canvas->updateCanvas(); delay(1000); } void loop() { }
Platform IO in VSCode¶
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Python, PHP, Go) and runtimes (such as .NET and Unity)
Note
Please note that you do not need to install PlatformIO Core(CLI) separately if you are going to use PlatformIO IDE for VSCode. PlatformIO Core(CLI) is built into PlatformIO IDE and you will be able to use it within PlatformIO IDE Terminal.
Git: If you are going to use Git for installing upstream development platforms, cloning external projects, installing library dependencies from a repository, please ensure that git --version command works from a system terminal. Otherwise, please install a Git client.
Linux Users: To ensure a smooth experience with PlatformIO, it is essential to have the python3-venv package installed on your system.
About Unihiker K10: The Unihiker K10 cannot currently be selected directly in Platform IO. You must first create a Platform IO project using another random DFRobot board, then modify the platformio.ini file and download the SDK before you can begin development.
- Open VSCode Package Manager
- Search for the official
platformio ideextension -
Install Unihiker K10 SDK
-
Click on โPlatformIO Homeโ button on the bottom PlatformIO Toolbar

-
Click on โNew Projectโ, select a random DFRobot board and create new PlatformIO Project.

-
Open
platformio.inifile, then copy and paste the following configure text in it. And usectrl+sto save the configure file.
Wait for the SDK download.
-
-
Run test code on Unihiker K10 Open
main.cppfile fromsrcfolder and replace its contents with the next:test code#include "unihiker_k10.h" UNIHIKER_K10 k10; uint8_t screen_dir = 2; void setup() { k10.begin(); k10.initScreen(screen_dir); k10.creatCanvas(); k10.setScreenBackground(0xFFFFFF); } void loop() { // Draw a green circle on the screen k10.canvas->canvasCircle(120, 160, 10, 0x00FF00, 0x00FF00, true); k10.canvas->updateCanvas(); delay(1000); // Clear the circle k10.canvas->canvasCircle(120, 160, 10, 0xFFFFFF, 0xFFFFFF, true); k10.canvas->updateCanvas(); delay(1000); }
Serial Setup¶
Like any other ESP32-S3 based dev board. The serial of Unihiker K10 is not automatically mapped to the USB-C port by default.
Although we have already included the configuration of serial port mapping in the above-mentioned platformio.ini configuration file, but from the second project, the settings related to the serial port in platformio.ini need to be set up manully.
Before uploading the code, please copy and paste the following Settings about the serial port at the end of platformio.ini. Then you can see the data output by the serial port in your code in the serial monitor.
The platformio.ini should look like this: 
Platform IO Example¶
Cklik to the Platform IO Example.


