-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/cziter15/ksIotFrameworkLib
- Loading branch information
Showing
3 changed files
with
69 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,71 @@ | ||
# Examples | ||
This is a directory that contains aplplication examples. | ||
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.** | ||
|
||
## IDE Preparation | ||
|
||
**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](https://code.visualstudio.com/). PlatformIO IDE is built on top of it. | ||
- Open the extension manager. | ||
- Search for the official `platformio ide` extension. | ||
- Install PlatformIO IDE extension. | ||
|
||
![image](https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/18dfb3a2-866c-4308-a197-5a90bbb13b90) | ||
|
||
## Opening existing projects | ||
- 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. | ||
|
||
## Creating your first application | ||
1. Open PlatformIO UI. | ||
2. Click on `New project`, and select your ESP version. Then click `Finish`. | ||
|
||
![image](https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/494565fa-4753-446c-a18e-c903626637a3) | ||
|
||
3. Open the `platformio.ini` file: | ||
|
||
![image](https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/1d882165-c64f-40a6-addb-36141837c5dc) | ||
|
||
4. Add the following code and save the file: | ||
```ini | ||
# Define library dependencies. | ||
lib_deps = | ||
ksIotFrameworkLib=https://github.com/cziter15/ksIotFrameworkLib | ||
``` | ||
5. Platformio will download required dependencies. Please be patient as it may take some time. | ||
6. Now open `main.cpp` file and replace the code with the following listing and save the file. | ||
```cpp | ||
#include <ksIotFrameworkLib.h> | ||
|
||
class MyApplication : public ksf::ksApplication | ||
{ | ||
public: | ||
bool init() override | ||
{ | ||
return true; | ||
} | ||
bool loop() override | ||
{ | ||
return true; | ||
} | ||
}; | ||
|
||
KSF_IMPLEMENT_APP_ROTATOR | ||
( | ||
MyApplication | ||
) | ||
``` | ||
|
||
7. Now you are able to build the application stub. | ||
|
||
![image](https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/afac0511-cf68-4007-ba89-b2902cabca6c) | ||
|
||
8. Now all that's left to do is implement the components and logic of your device. | ||
|
||
# Examples | ||
|
||
# [basic-config](basic-config) | ||
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. |
This file was deleted.
Oops, something went wrong.