From d082f72b1af1230d3330a992001ce83be4c8ef7c Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Tue, 28 May 2024 14:22:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96mcu=E4=B8=ADled?= =?UTF-8?q?=E7=81=AF=E7=9A=84=E7=8A=B6=E6=80=81=E5=AD=98=E5=82=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ mcuClients/clientFor5050RGB/clientFor5050RGB.ino | 6 +++++- readme.md | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72256d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*/.idea +*/.vscode \ No newline at end of file diff --git a/mcuClients/clientFor5050RGB/clientFor5050RGB.ino b/mcuClients/clientFor5050RGB/clientFor5050RGB.ino index f4bfb5b..e251b6f 100644 --- a/mcuClients/clientFor5050RGB/clientFor5050RGB.ino +++ b/mcuClients/clientFor5050RGB/clientFor5050RGB.ino @@ -133,8 +133,12 @@ void ledSave(int ledNum, uint8_t r, uint8_t g, uint8_t b, uint8_t lig, int statu leds[ledNum - 1].ledNumber = ledNum; leds[ledNum - 1].status = status; if (lig == 0) { + // 关灯 + leds[ledNum - 1].color = strip.Color(0, 0, 0); + } if(lig==100){ + // 正常 leds[ledNum - 1].color = strip.Color(r, g, b); - } else { + }else { // 使用亮度换算rgb颜色 leds[ledNum - 1].color = strip.Color((r * lig) / 255, (g * lig) / 255, (b * lig)); } diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..a6470ae --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# fonchain-container 货架服务 +## 项目说明 +项目包含硬件mcu程序和软件服务端程序。mcu程序基于C++开发,位于[./mcuClients](./mcuClients)目录中,服务端位于[./containerServer](./containerServer)目录中 \ No newline at end of file