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 using one of the patterns described earlier; either BoardDefaults or getI2CBus().

val display = AlphanumericDisplay(i2cBusName)
display.setEnabled(true)
[...]

And that's it;  the rest of the interaction with the alphanumeric display is exactly the same as we did before.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.23.130