From d3261df8fd889bd36f9a2ba34313c1a9142aabf6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Sat, 26 Aug 2017 00:21:50 +0200 Subject: [PATCH] Changed 'level' to 'brightness' --- config.properties.template | 4 ++-- src/kaka/cakelight/Configuration.java | 4 ++-- src/kaka/cakelight/LedFrame.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.properties.template b/config.properties.template index 77f6aeb..d7333fb 100644 --- a/config.properties.template +++ b/config.properties.template @@ -14,8 +14,8 @@ video.crop.bottom=18 # Supported types: apa102, ws2801 leds.type=apa102 -# Light level: 1-31 -leds.level=31 +# LED brightness: 1-31 +leds.brightness=31 leds.cols=32 leds.rows=17 diff --git a/src/kaka/cakelight/Configuration.java b/src/kaka/cakelight/Configuration.java index 286da18..4a6a6a6 100644 --- a/src/kaka/cakelight/Configuration.java +++ b/src/kaka/cakelight/Configuration.java @@ -98,13 +98,13 @@ public class Configuration { public class LedConfiguration { public int cols; public int rows; - public int level; + public int brightness; public LedType type; private LedConfiguration(Properties prop) { cols = Integer.parseInt(get(prop, "leds.cols")); rows = Integer.parseInt(get(prop, "leds.rows")); - level = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.level", "31")))); + brightness = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.brightness", "31")))); switch (get(prop, "leds.type", "").toUpperCase()) { case "WS2801": type = LedType.WS2801; diff --git a/src/kaka/cakelight/LedFrame.java b/src/kaka/cakelight/LedFrame.java index cb92dab..546e78b 100644 --- a/src/kaka/cakelight/LedFrame.java +++ b/src/kaka/cakelight/LedFrame.java @@ -37,7 +37,7 @@ public class LedFrame { frame.goff = 2 + 4; frame.boff = 1 + 4; frame.bytes = new byte[4 + config.leds.getCount() * frame.stride + 4]; - Arrays.fill(frame.bytes, 4, frame.bytes.length - 5, (byte)(0b11100000 | config.leds.level)); // Initiate the first byte of each LED + Arrays.fill(frame.bytes, 4, frame.bytes.length - 5, (byte)(0b11100000 | config.leds.brightness)); // Initiate the first byte of each LED Arrays.fill(frame.bytes, frame.bytes.length - 5, frame.bytes.length - 1, (byte)0xff); // Initiate the end frame with ones break; } -- 2.11.0