| 1 | package kaka.cakelight; |
| 2 | |
| 3 | import com.pi4j.io.spi.SpiChannel; |
| 4 | import com.pi4j.io.spi.SpiDevice; |
| 5 | import com.pi4j.io.spi.SpiFactory; |
| 6 | |
| 7 | import java.io.IOException; |
| 8 | |
| 9 | public class LedController { |
| 10 | public static void main(String args[]) { |
| 11 | new LedController(null); |
| 12 | } |
| 13 | |
| 14 | public LedController(Configuration config) { |
| 15 | try { |
| 16 | SpiDevice spi = SpiFactory.getInstance(SpiChannel.CS0); |
| 17 | spi.write( |
| 18 | (byte)0xff, (byte)0x0, (byte)0x0, |
| 19 | (byte)0x00, (byte)0xff, (byte)0x0, |
| 20 | (byte)0x0, (byte)0x00, (byte)0xff |
| 21 | ); |
| 22 | } catch (IOException e) { |
| 23 | e.printStackTrace(); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | public void onFrame(LedFrame ledFrame) { |
| 28 | // TODO |
| 29 | } |
| 30 | } |