X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FLedFrame.java;h=18b8f226e8de066e062bec118410586fc9fa847d;hb=a276d5abce63f4d7b54ae59a026730fdf7591b85;hp=cb92dabb823aa2a2635bde6f10aecbc966729b9c;hpb=f2eedb6d98ae638d65c9bfd1a9a339a060235592;p=kaka%2Fcakelight.git diff --git a/src/kaka/cakelight/LedFrame.java b/src/kaka/cakelight/LedFrame.java index cb92dab..18b8f22 100644 --- a/src/kaka/cakelight/LedFrame.java +++ b/src/kaka/cakelight/LedFrame.java @@ -8,6 +8,9 @@ public class LedFrame { private int stride; private int roff, goff, boff; // RGB offsets + /** + * @return a frame initiated to black + */ public static LedFrame from(Configuration config) { LedFrame frame = new LedFrame(); frame.config = config; @@ -37,7 +40,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; }