public LedController(Configuration config) {
try {
spi = SpiFactory.getInstance(SpiChannel.CS0);
-// spi.write(
-// (byte)0xff, (byte)0x0, (byte)0x0,
-// (byte)0x00, (byte)0xff, (byte)0x0,
-// (byte)0x0, (byte)0x00, (byte)0xff
-// );
} catch (IOException e) {
e.printStackTrace();
}
CakeLight cakelight = new CakeLight(config, new LedController(config));
cakelight.setMode(new AmbientMode());
cakelight.startLoop();
-// try {
-// Thread.sleep(1000);
-// } catch (InterruptedException e) {
-// e.printStackTrace();
-// }
-// cakelight.setMode(null);
Runtime.getRuntime().addShutdownHook(new Thread(Main::printTimeStats));
}
if (frameConsumer != null) frame.ifPresent(frameConsumer);
frame.ifPresent(VideoMode.this::onFrame);
// timeIt("frame", grabber::grabFrame);
- // TODO: process frame
- // TODO: save where the LedController can access it
}
} catch (IOException e) {
e.printStackTrace();