A very simple Waveshare eInk display module driver implementation for Android Things
dependencies {
compile 'com.nilhcem.androidthings:driver-wsepd:0.0.2'
}
Tested on Waveshare 2.9inch e-Paper Module
// Access the EPD2X9 display
EPaperDisplay display;
EPaperDisplay.DeviceType epd2x9 = EPaperDisplay.DeviceType.Preset.EPD2X9.deviceType;
display = EPaperDisplay.Factory.create(SPI_NAME, BUSY_GPIO, RESET_GPIO, DC_GPIO, epd2x9);
// Clear screen
display.clear();
// Set pixels
byte[] rawPixels = SampleData.WAVESHARE_LOGO;
display.setPixels(rawPixels);
// Set a bitmap
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.android);
byte[] bmpPixels = BitmapHelper.bmpToBytes(bmp);
display.setPixels(bmpPixels);
// Refresh the screen
display.refresh();
// Close the display when finished
display.close();
e-Paper | Raspberry Pi 3 |
---|---|
3.3V | 3.3V |
GND | GND |
DIN | MOSI (#19) |
CLK | SCLK (#23) |
CS | CE0 (#24) |
DC | BCM25 (#22) |
RST | BCM17 (#11) |
BUSY | BCM24 (#18) |
- Novoda, and Blundell for their InkypHat driver