磁铁、舵机、网页控制、通信协议

This commit is contained in:
kirl committed 2026-07-29 21:11:16 +08:00
1 parent 230ad1254a
commit 40ee976236
17 files changed
+1879 -32

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
/**
* @file magnet.h
* @brief 单 GPIO 电磁铁控制
*/
#ifndef MAGNET_H
#define MAGNET_H
#include <stdbool.h>
#include "driver/gpio.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief 初始化电磁铁 GPIO (推挽输出, 默认关闭)
* @param gpio GPIO 引脚号, 如 GPIO_NUM_5
*/
void magnet_init(int gpio);
/**
* @brief 设置电磁铁状态
* @param on true=吸合, false=释放
*/
void magnet_set(bool on);
#ifdef __cplusplus
}
#endif
#endif /* MAGNET_H */