Search in sources :

Example 1 with MatrixRotation

use of com.robo4j.hw.rpi.i2c.adafruitbackpack.MatrixRotation in project robo4j by Robo4J.

the class Adafruit8x8MatrixUnit method onInitialization.

@Override
protected void onInitialization(Configuration configuration) throws ConfigurationException {
    super.onInitialization(configuration);
    int brightness = configuration.getInteger(ATTRIBUTE_BRIGHTNESS, AbstractBackpack.DEFAULT_BRIGHTNESS);
    MatrixRotation rotation = MatrixRotation.valueOf(configuration.getString(ATTRIBUTE_ROTATION, DEFAULT_MATRIX_ROTATION).toUpperCase());
    try {
        device = new BiColor8x8MatrixDevice(getBus(), getAddress(), brightness);
    } catch (IOException e) {
        throw new ConfigurationException("Failed to instantiate device", e);
    }
    device.setRotation(rotation);
}
Also used : BiColor8x8MatrixDevice(com.robo4j.hw.rpi.i2c.adafruitbackpack.BiColor8x8MatrixDevice) ConfigurationException(com.robo4j.ConfigurationException) MatrixRotation(com.robo4j.hw.rpi.i2c.adafruitbackpack.MatrixRotation) IOException(java.io.IOException)

Aggregations

ConfigurationException (com.robo4j.ConfigurationException)1 BiColor8x8MatrixDevice (com.robo4j.hw.rpi.i2c.adafruitbackpack.BiColor8x8MatrixDevice)1 MatrixRotation (com.robo4j.hw.rpi.i2c.adafruitbackpack.MatrixRotation)1 IOException (java.io.IOException)1