/wsepd-androidthings

WaveShare E-Paper Display driver for Android Things

Primary LanguageJavaApache License 2.0Apache-2.0

Waveshare e-Paper Display module driver for Android Things

A very simple Waveshare eInk display module driver implementation for Android Things

preview

Download

dependencies {
    compile 'com.nilhcem.androidthings:driver-wsepd:0.0.2'
}

Usage

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();

Hardware connection

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)

Kudos to