Skip to content

Commit d194ecf

Browse files
committed
更新README.md,修改多灯库使用问题
1 parent 8bd8060 commit d194ecf

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

main/boards/mixgo-nova/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# 元控·青春
1+
# Mixgo_Nova(元控·青春) 开发板
22

3-
## 编译配置命令
3+
<img src="https://mixly.cn/public/icon/2024/6/09705006c1c643beb96338791ee1dea0_m.png" alt="Mixgo_Nova" width="200"/>
4+
5+
&zwnj;**[Mixgo_Nova](https://mixly.cn/fredqian/mixgo_nova)**&zwnj; 是一款专为物联网、教育及创客项目设计的多功能开发板,集成丰富传感器与无线通信模块,支持图形化编程(Mixly)和离线语音交互,适合快速原型开发与教学。
6+
7+
---
8+
9+
## 🛠️ 编译配置命令
410

511
**ES8374 CODE MIC采集问题:**
612

@@ -57,4 +63,10 @@ Partition Table -> Custom partition CSV file -> partitions_8M.csv
5763

5864
```bash
5965
idf.py build
66+
```
67+
68+
**合并BIN:**
69+
70+
```bash
71+
idf.py merge-bin -o xiaozhi-nova.bin -f raw
6072
```

main/boards/mixgo-nova/mixgo-nova.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "config.h"
77
#include "i2c_device.h"
88
#include "iot/thing_manager.h"
9-
#include "led/single_led.h"
9+
#include "led/circular_strip.h"
1010
#include "assets/lang_config.h"
1111

1212
#include <esp_log.h>
@@ -157,7 +157,7 @@ class MIXGO_NOVA : public WifiBoard {
157157
}
158158

159159
virtual Led* GetLed() override {
160-
static SingleLed led(BUILTIN_LED_GPIO);
160+
static CircularStrip led(BUILTIN_LED_GPIO, 4);
161161
return &led;
162162
}
163163

main/led/single_led.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SingleLed::SingleLed(gpio_num_t gpio) {
1717

1818
led_strip_config_t strip_config = {};
1919
strip_config.strip_gpio_num = gpio;
20-
strip_config.max_leds = 4;
20+
strip_config.max_leds = 1;
2121
strip_config.led_pixel_format = LED_PIXEL_FORMAT_GRB;
2222
strip_config.led_model = LED_MODEL_WS2812;
2323

@@ -62,9 +62,6 @@ void SingleLed::TurnOn() {
6262
std::lock_guard<std::mutex> lock(mutex_);
6363
esp_timer_stop(blink_timer_);
6464
led_strip_set_pixel(led_strip_, 0, r_, g_, b_);
65-
led_strip_set_pixel(led_strip_, 1, r_, g_, b_);
66-
led_strip_set_pixel(led_strip_, 2, r_, g_, b_);
67-
led_strip_set_pixel(led_strip_, 3, r_, g_, b_);
6865
led_strip_refresh(led_strip_);
6966
}
7067

@@ -108,9 +105,6 @@ void SingleLed::OnBlinkTimer() {
108105
blink_counter_--;
109106
if (blink_counter_ & 1) {
110107
led_strip_set_pixel(led_strip_, 0, r_, g_, b_);
111-
led_strip_set_pixel(led_strip_, 1, r_, g_, b_);
112-
led_strip_set_pixel(led_strip_, 2, r_, g_, b_);
113-
led_strip_set_pixel(led_strip_, 3, r_, g_, b_);
114108
led_strip_refresh(led_strip_);
115109
} else {
116110
led_strip_clear(led_strip_);

0 commit comments

Comments
 (0)