Following the same approach as for GPIO and PWM, we are going to start by removing the Rainbow HAT meta driver from our dependencies and using the specific drivers of the components directly. This time the components are the alphanumeric display and the temperature and pressure sensor.
Revisiting Rainbow HAT components
Alphanumeric display (Ht16k33)
The driver for the alphanumeric display is called driver-ht16k33, so we just need to add it to our build.gradle:
dependencies {
[...]
implementation 'com.google.android.things.contrib:driver-ht16k33:+'
}
The only difference with the code we used before is that we now have to construct an object of type AlphanumericDisplay passing the I2C bus name, which we can initialize...