From 042605701ef6b6fa7a7bc88b7ef26793c1b2eea7 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 27 Oct 2018 11:39:00 +0200 Subject: [PATCH] Added DNRGB UDP protocol --- wled00/wled00.ino | 2 +- wled00/wled07_notify.ino | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index c27ee703..ae57bef2 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -58,7 +58,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1810251 +#define VERSION 1810271 char versionString[] = "0.8.1"; diff --git a/wled00/wled07_notify.ino b/wled00/wled07_notify.ino index d77f5bba..7f03b403 100644 --- a/wled00/wled07_notify.ino +++ b/wled00/wled07_notify.ino @@ -220,6 +220,15 @@ void handleNotifications() { setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]); + id++; if (id >= ledCount) break; + } + } else if (udpIn[0] == 4) //dnrgb + { + uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00); + for (uint16_t i = 4; i < packetSize -2; i += 3) + { + setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]); + id++; if (id >= ledCount) break; } } @@ -243,5 +252,3 @@ void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w) } } } - -