Java源码示例:com.google.android.things.contrib.driver.ht16k33.AlphanumericDisplay
示例1
public CarController(MotorHat motorHat, TricolorLed led, AlphanumericDisplay display) {
mMotorHat = motorHat;
mLed = led;
mDisplay = display;
mHandlerThread = new HandlerThread("CarController-worker");
mHandlerThread.start();
mHandler = new Handler(mHandlerThread.getLooper());
}
示例2
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "Starting SegmentDisplayActivity");
try {
mSegmentDisplay = new AlphanumericDisplay(I2C_BUS);
mSegmentDisplay.setBrightness(1.0f);
mSegmentDisplay.setEnabled(true);
mSegmentDisplay.clear();
mSegmentDisplay.display("ABCD");
} catch (IOException e) {
Log.e(TAG, "Error configuring display", e);
}
}
示例3
/**
* Opens display and writes values to it.
*/
@Test
public void testDisplay() throws IOException {
AlphanumericDisplay display = RainbowHat.openDisplay();
display.display("TEST");
display.clear();
display.close();
}
示例4
public static AlphanumericDisplay openDisplay() throws IOException {
return new AlphanumericDisplay(BOARD.getI2cBus());
}