1 package kaka.cakelight;
3 import com.pi4j.io.spi.SpiChannel;
4 import com.pi4j.io.spi.SpiDevice;
5 import com.pi4j.io.spi.SpiFactory;
7 import java.io.IOException;
9 public class LedController {
10 private SpiDevice spi;
12 public static void main(String args[]) {
13 new LedController(null);
16 public LedController(Configuration config) {
18 spi = SpiFactory.getInstance(SpiChannel.CS0);
20 // (byte)0xff, (byte)0x0, (byte)0x0,
21 // (byte)0x00, (byte)0xff, (byte)0x0,
22 // (byte)0x0, (byte)0x00, (byte)0xff
24 } catch (IOException e) {
29 public void onFrame(LedFrame ledFrame) {
31 spi.write(ledFrame.getBytes());
32 } catch (IOException e) {