smallin/my_switch

1.0.0

Latest
uploaded 1 week ago
一个简单的开关组件

readme

# MySwitch组件

- MySwitch是一个用于控制开头类的控制组件,提供开头状态控制、循环工作、工作结束回调支持。

## 主要特性
- 状态管理
    - IDLE:空闲状态
    - RUN:运行状态
    - PAUSE:暂停状态
    - FINISHED:工作完成状态
- 配置参数
    - 最大/最小工作时间
    - 最大/最小暂停时间
    - 最大/最小工作次数
- 工作完成回调:支持注册工作完成事件回调函数

## 快速开始
```
#include "my_switch.hpp"

int main()
{
    MySwitch my_switch(GPIO_NUM_12, true);
    my_switch.set_work_para(5, 2, 3);
    my_switch.set_work_done_callback(callback, nullptr);
    my_switch.start();
}
```

Links

Supports all targets

License: Apache 2.0

To add this component to your project, run:

idf.py add-dependency "smallin/my_switch^1.0.0"

or download archive

Stats

  • Archive size
    Archive size ~ 4.11 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

smallin/my_switch version: 1.0.0
|