actuator应用层基本完成

This commit is contained in:
kirl committed 2026-07-31 17:51:37 +08:00
1 parent 32a3a87ef2
commit a226b15413
9 files changed
+1081 -44

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
PRIV_REQUIRES emm_v5 magnet servo web_ctrl protocol rgb)
PRIV_REQUIRES emm_v5 magnet servo web_ctrl protocol rgb actuator)
+3 -5
View File
@@ -26,6 +26,7 @@
#include "web_ctrl.h"
#include "protocol.h"
#include "rgb.h"
#include "actuator.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
@@ -38,15 +39,12 @@ void app_main(void)
rgb_init(GPIO_NUM_27);
rgb_set(32, 32, 0); /* 黄色 (低亮), 表示启动中 */
/* 初始化电机驱动 (UART1, TX=GPIO6, RX=GPIO7, LED=GPIO2) */
Emm_V5_Init(UART_NUM_1, GPIO_NUM_6, GPIO_NUM_7);
/* 初始化执行器 (步进电机 + 舵机) */
actuator_init();
/* 初始化电磁铁 (GPIO5) */
magnet_init(GPIO_NUM_5);
/* 初始化舵机 (GPIO4, 上限180° 下限0°) */
servo_init(GPIO_NUM_4);
/* 初始化通讯协议 (I2C 从机 GPIO2/3 + UART0 GPIO11/12) */
edc_proto_init(NULL);