Initializing the display in the THINKINK_GRAYSCALE4 mode leaves me with an unwanted black border around the display area. I had wanted to use the display for a graph, but I'm going to have to move the axes several pixels away to avoid losing them in the border box. The only way I can avoid the appearance of the border is if I use an all-black background.
I didn't include photos, but the THINKINK_MONO mode sets a white border. This could be an issue if I planned on writing white text/plot axes on a black background. I guess I'm not as worried about that, but it's odd that it's different from the Grayscale border.
I've attached a small demo program which shows the border in action. My code sets a background with some text and draws single-pixel 'pips' at the min/max coordinates of the display to show that the border is outside the addressable area. You'll likely need a magnifier to see the pips.
So: Is there a way to control/customize the appearance of the border?
Code: Select all
/***************************************************
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
#include "Adafruit_ThinkInk.h"
#define EPD_DC 7 // can be any pin, but required!
#define EPD_CS 8 // can be any pin, but required!
#define EPD_BUSY 5 // can set to -1 to not use a pin (will wait a fixed delay)
#define SRAM_CS -1 // can set to -1 to not use a pin (uses a lot of RAM!)
#define EPD_RESET 6 // can set to -1 and share with chip Reset (can't deep sleep)
// 2.9" Grayscale Featherwing or Breakout:
ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
const int BUTTON_PIN = 0;
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
Serial.println();
Serial.println();
display.begin(THINKINK_GRAYSCALE4);
display.clearBuffer();
display.fillScreen(EPD_LIGHT);
display.setTextSize(4);
display.setTextColor(EPD_BLACK);
display.setCursor(0, 0);
display.print("Greyscale4\n\n Button 0\n for next");
drawPips();;
display.display();
waitForButton();
display.begin(THINKINK_GRAYSCALE4);
display.clearBuffer();
display.fillScreen(EPD_LIGHT);
display.setTextSize(4);
display.setTextColor(EPD_WHITE);
display.setCursor(0, 0);
display.print("Greyscale4\n\n Button0\n for next");
drawPips();
display.display();
waitForButton();
display.begin(THINKINK_MONO);
display.clearBuffer();
//display.fillScreen(EPD_WHITE); // Don't do this in Monochrome.
display.setTextSize(4);
//display.setTextColor(EPD_BLACK); // Doesn't do anything in Monochrome?
display.setCursor(0, 0);
display.print("Monochrome\n\n Button 0\n for next");
drawPips();
display.display();
waitForButton();
// Counterintuitively - for me - I can't do a fillScreen(EPD_BLACK) and
// a setTextColor(EPD_WHITE) to get white text on a black background. I have to
// do some sort of invert thing with setBlackBuffer() and setColorBuffer().
display.begin(THINKINK_MONO);
display.setBlackBuffer(1, false);
display.setColorBuffer(1, false);
display.clearBuffer();
//display.fillScreen(EPD_WHITE); // Don't do this in Monochrome.
display.setTextSize(4);
//display.setTextColor(EPD_BLACK); // Doesn't do anything in Monochrome?
display.setCursor(0, 0);
display.print("Mono/invert\n\n Button 0\n to restart");
drawPips();
display.display();
waitForButton();
}
void drawPips() {
int displayHeight=display.height();
int displayWidth=display.width();
display.drawPixel(0,displayHeight/2,EPD_BLACK);
display.drawPixel(displayWidth-1,displayHeight/2,EPD_BLACK);
display.drawPixel(displayWidth/2,0,EPD_BLACK);
display.drawPixel(displayWidth/2,displayHeight-1,EPD_BLACK);
}
void waitForButton() {
while (digitalRead(BUTTON_PIN) == HIGH) {delay(1);}
while (digitalRead(BUTTON_PIN) == LOW) {delay(1);}
}