adafruit / Adafruit-ST7735-Library

This is a library for the Adafruit 1.8" SPI display http://www.adafruit.com/products/358 and http://www.adafruit.com/products/618
https://learn.adafruit.com/1-8-tft-display
547 stars 303 forks source link

Not working with Circuit Playground Express board and 152x152 Tri-Color E-Ink Gizmo #178

Open ncmikkelsen opened 1 year ago

ncmikkelsen commented 1 year ago

GizmoTest.ino example from Adafruit EPD library does not result in any graphics on the display. I only receive the prints in the serial monitor. Posting this as an issue here as directed in the below linked adafruit thread. Please let me know if there is a more suitable place for the issue.

Steps to reproduce:

Here is the code (note that I have uncommented the line selecting the correct chipset for the display):

/***************************************************
  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_CS      0
#define EPD_DC      1
#define SRAM_CS     -1
#define EPD_RESET   PIN_A3 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY    -1 // can set to -1 to not use a pin (will wait a fixed delay)

// You will need to use Adafruit's CircuitPlayground Express Board Definition
// for Gizmos rather than the Arduino version since there are additional SPI
// ports exposed.
#if (SPI_INTERFACES_COUNT == 1)
  SPIClass* spi = &SPI;
#else
  SPIClass* spi = &SPI1;
#endif

// 1.54" 152x152 Tricolor EPD with ILI0373 chipset
ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
// 1.54" 200x200 Tricolor EPD with SSD1681 chipset
//ThinkInk_154_Tricolor_Z90 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

float p = 3.1415926;

void setup(void) {
  Serial.begin(115200);
  Serial.print("Hello! EPD Gizmo Test");

  display.begin(THINKINK_TRICOLOR);

  Serial.println("Initialized");
}

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(const char *text, uint16_t color) {
  display.setCursor(0, 0);
  display.setTextColor(color);
  display.setTextWrap(true);
  display.print(text);
}

I have followed the guide provided by adafruit here: https://learn.adafruit.com/adafruit-circuit-playground-tri-color-e-ink-gizmo/arduino-code And debugged in the adafruit forum which can be found here: https://forums.adafruit.com/viewtopic.php?t=173038 As mentioned in the forum thread I have tried with two different gizmos with two different, known working, circuit playground express boards. The thread is over a year old but I have tried the example and the suggested steps again today, with no result. I am using the Adafruit Circuit Playground Express board from the Adafruit SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards package.

The same gizmo and express board is working with the circuitpython from the adafruit guide: https://learn.adafruit.com/adafruit-circuit-playground-tri-color-e-ink-gizmo/circuitpython