In this directory, you will find examples that guide you through building various firmware applications.
Before you start, read this page to ensure you are familiar with PlatformIO and have the correct IDE setup.
When using PlatformIO, no additional setup is required, and you don't need to install the Arduino IDE separately. This library can be used with the Arduino IDE, though it may be suboptimal.
- Download and install official Microsoft Visual Studio Code. PlatformIO IDE is built on top of it.
- Open the extension manager.
- Search for the official
platformio ide
extension. - Install PlatformIO IDE extension.
- If properly configured, the project should contain a
platformio.ini
file in its main directory. - To open a project, use the
Open Folder
option from the File menu. - Dependencies will be automatically installed, which may take some time.
- Open PlatformIO UI.
- Click on
New project
, and select your ESP version. Then clickFinish
.
- Open the
platformio.ini
file:
- Add the following code and save the file:
# Define library dependencies.
lib_deps =
ksIotFrameworkLib=https://github.com/cziter15/ksIotFrameworkLib
- Platformio will download required dependencies. Please be patient as it may take some time.
- Now open
main.cpp
file and replace the code with the following listing and save the file.
#include <ksIotFrameworkLib.h>
class MyApplication : public ksf::ksApplication
{
public:
bool init() override
{
return true;
}
bool loop() override
{
return true;
}
};
KSF_IMPLEMENT_APP_ROTATOR
(
MyApplication
)
- Now you are able to build the application stub.
- Now all that's left to do is implement the components and logic of your device.
This application demonstrates how create most typical application stack. One ksApplication is responsible for device logic and the another is the application that is used to configure the device.