The 2.7" EInk Shield is a little special in that the pins are fixed, so we'll document that here.
Power Pins
- 5V - this pin on the Arduino is used to generate the 3V logic level for the EInk chip, level shifter and boost converter.
- GND - connected for power and logic reference
- IORef - this pin is connected to the level shifter and pullups. On modern Arduino boards it is connected to the logic level of the board (3V or 5V)
Data Pins
- SCK, MISO, MOSI - The 3 SPI logic pins are connected through the 2x3 socket header which is compatible with any Arduino board. If you have an Arduino board without the 2x3 headers, you can cut the jumpers and connect the solder jumper traces to D13, D12 and D11 respectively.
- ECS (EInk Chip Select) - this is connected to D10
- DC (EInk Data/Command) - this is connected to D9
- SCS (SRAM Chip Select) - this is connected to D8
- SDCS (SD Card Chip Select) - this is connected to D5
The BUSY pin is not used on the 2.7" display (it doesn't do anything anyways)
The RESET pin is connected to the microcontroller reset pin, but is available on a pad labeled EReset if you want to toggle it yourself!
Buttons
The 4 buttons on the front are connected through a resistor divider to A3 you can use this function to determine what button was pressed:
int8_t readButtons(void) { uint16_t reading = analogRead(A3); //Serial.println(reading); if (reading > 600) { return 0; // no buttons pressed } if (reading > 400) { return 4; // button D pressed } if (reading > 250) { return 3; // button C pressed } if (reading > 125) { return 2; // button B pressed } return 1; // Button A pressed }
Here's a simple test example for an Arduino with standard pin numbers:
/*************************************************** 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 9 // can be any pin, but required! #define EPD_CS 10 // can be any pin, but required! #define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay) #define SRAM_CS 8 // can set to -1 to not use a pin (uses a lot of RAM!) #define EPD_RESET -1 // can set to -1 and share with chip Reset (can't deep sleep) // 2.7" Tricolor Featherwing or Breakout with IL91874 chipset ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); void setup() { Serial.begin(115200); while (!Serial) { delay(10); } Serial.println("Adafruit EPD full update test in red/black/white"); display.begin(THINKINK_TRICOLOR); display.setRotation(2); } void loop() { Serial.println("Banner demo"); display.clearBuffer(); display.setTextSize(3); display.setCursor((display.width() - 144)/2, (display.height() - 24)/2); display.setTextColor(EPD_BLACK); display.print("Tri"); display.setTextColor(EPD_RED); display.print("Color"); display.display(); delay(15000); Serial.println("Color rectangle demo"); display.clearBuffer(); display.fillRect(display.width()/3, 0, display.width()/3, display.height(), EPD_BLACK); display.fillRect((display.width()*2)/3, 0, display.width()/3, display.height(), EPD_RED); display.display(); delay(15000); Serial.println("Text demo"); // large block of text display.clearBuffer(); display.setTextSize(1); testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", EPD_BLACK); display.display(); delay(15000); display.clearBuffer(); for (int16_t i=0; i<display.width(); i+=4) { display.drawLine(0, 0, i, display.height()-1, EPD_BLACK); } for (int16_t i=0; i<display.height(); i+=4) { display.drawLine(display.width()-1, 0, 0, i, EPD_RED); } display.display(); delay(15000); } void testdrawtext(char *text, uint16_t color) { display.setCursor(0, 0); display.setTextColor(color); display.setTextWrap(true); display.print(text); }
Text editor powered by tinymce.