forked from xiaozhi/xiaozhi-esp32
更新ESP32 CGC MCP控制方式,添加一个ESP32 CGC 144的开发板 (#736)
* Update README.md * Update config.h 增加MCP控制方式 * Update esp32_cgc_board.cc 增加MCP控制方式 * Update CMakeLists.txt 增加ESP32 CGC 144开发板 * Update Kconfig.projbuild 增加ESP32 CGC 144开发板 * Create README.md 增加ESP32 CGC 144开发板 * Add files via upload * Update config.h 修改注释
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# 主板开源地址:
|
||||
[https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb](https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb)
|
||||
- V1:[https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb](https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb)
|
||||
- V2:[https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb_copy](https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb_copy)
|
||||
- 更多介绍:[wdmomo.fun](https://www.wdmomo.fun:81/doc/index.html?file=001_%E8%AE%BE%E8%AE%A1%E9%A1%B9%E7%9B%AE/0001_%E5%B0%8F%E6%99%BAAI/002_ESP32-CGC%E5%BC%80%E5%8F%91%E6%9D%BF%E5%B0%8F%E6%99%BAAI)
|
||||
|
||||
# 编译配置命令
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
||||
#define ASR_BUTTON_GPIO GPIO_NUM_13
|
||||
|
||||
// A MCP Test: Control a lamp
|
||||
#define LAMP_GPIO GPIO_NUM_12
|
||||
|
||||
#define DISPLAY_SDA_PIN GPIO_NUM_NC
|
||||
#define DISPLAY_SCL_PIN GPIO_NUM_NC
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "application.h"
|
||||
#include "button.h"
|
||||
#include "config.h"
|
||||
#include "mcp_server.h"
|
||||
#include "lamp_controller.h"
|
||||
#include "iot/thing_manager.h"
|
||||
#include "led/single_led.h"
|
||||
|
||||
@@ -152,9 +154,14 @@ private:
|
||||
|
||||
// 物联网初始化,添加对 AI 可见设备
|
||||
void InitializeIot() {
|
||||
#if CONFIG_IOT_PROTOCOL_XIAOZHI
|
||||
auto& thing_manager = iot::ThingManager::GetInstance();
|
||||
thing_manager.AddThing(iot::CreateThing("Speaker"));
|
||||
thing_manager.AddThing(iot::CreateThing("Screen"));
|
||||
thing_manager.AddThing(iot::CreateThing("Lamp"));
|
||||
#elif CONFIG_IOT_PROTOCOL_MCP
|
||||
static LampController lamp(LAMP_GPIO);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user