From e7032a62b06a38c5b14935d984c037c59e2d9815 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 20 Mar 2021 15:43:59 +0100 Subject: [PATCH] Offset between LUA and simulation adapted --- simulation/src/de/c3ma/ollo/mockup/ESP8266Ws2812.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simulation/src/de/c3ma/ollo/mockup/ESP8266Ws2812.java b/simulation/src/de/c3ma/ollo/mockup/ESP8266Ws2812.java index f95cd1a..e386ef2 100644 --- a/simulation/src/de/c3ma/ollo/mockup/ESP8266Ws2812.java +++ b/simulation/src/de/c3ma/ollo/mockup/ESP8266Ws2812.java @@ -177,7 +177,7 @@ public class ESP8266Ws2812 extends TwoArgFunction { int r = array[0]+(Byte.MIN_VALUE*-1); int b = array[1]+(Byte.MIN_VALUE*-1); int g = array[2]+(Byte.MIN_VALUE*-1); - ESP8266Ws2812.layout.updateLED(index, r, g, b); + ESP8266Ws2812.layout.updateLED(index - 1, r, g, b); } }); return LuaValue.valueOf(true); @@ -203,7 +203,7 @@ public class ESP8266Ws2812 extends TwoArgFunction { final int offset = arg.toint(); if (ESP8266Ws2812.layout != null) { - Element e = ESP8266Ws2812.layout.getLED(offset); + Element e = ESP8266Ws2812.layout.getLED(offset - 1); if (e != null) { Color color = e.getColor(); final byte[] array = new byte[3];