๐ŸŽ„โ›„โ„๏ธ๐ŸŽ It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! ๐ŸŽ„โ›„โ„๏ธ๐ŸŽ
0

SSD1351 Library Missing Members?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

SSD1351 Library Missing Members?

by CodeToad on Sat Jan 12, 2019 12:43 am

Hi,

Trying to run some demo code. The compiler is saying that 'class Adafruit_SSD1351' has no member named 'writeData' (as well as a number of other methods)

If it matters:
Board: Arduino Zero
Display: SSD1351
Connection/Power: USB

Thinking the demo code I was using might be out of date, I checked the Github repository. I see the constructor I'm using is out of date, but still acceptable. But I did not find any evidence of a "writeData" method ever existing or ever being deprecated (although I'm not super familiar with Git so I may have missed something). Pretty confused as to how this code could have worked. Thanks for your insight.

A lot of code has been removed for clarity...

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include <SPI.h>


// If we are using the hardware SPI interface, these are the pins (for future ref)
#define my_dc   8
#define my_cs   9
#define my_rst  7

// Color definitions
#define   BLACK           0x0000
#define   BLUE            0x001F
#define   RED             0xF800
#define   GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0 
#define WHITE           0xFFFF

// this is a deprecated constructor, but I don't see how that would affect the missing methods
Adafruit_SSD1351 tft = Adafruit_SSD1351(my_cs, my_dc, my_rst);
// tft will be the only variable of the Adafruit_SSD1351 class 

void setup(void) {

// initialize the OLED
  tft.begin();

}

void loop() {
   cls(BLACK);
   lcdTestPattern()
}

void lcdTestPattern() {

uint32_t i,j;
  tft.goTo(0, 0);    <-- goTo method here also throws an "missing method" error
 
  for(i=0;i<128;i++)
  {
    for(j=0;j<128;j++)
    {
      if(i<16){
        tft.writeData(RED>>8); tft.writeData(RED);  <-- error
      }
      else if(i<32) {
        tft.writeData(YELLOW>>8);tft.writeData(YELLOW); <-- error
      }
<snip>
}


CodeToad
 
Posts: 12
Joined: Sat Jan 12, 2019 12:01 am

Re: SSD1351 Library Missing Members?

by adafruit_support_mike on Sat Jan 12, 2019 2:40 am

That code won't work with the latest version of the SSD1351 library. As you've found, the library no longer has the functions you're trying to use.

We've consolidated our TFT displays with a new class named Adafruit_SPITFT that lives in the GFX library. Most of the communication is done using graphics primitive functions like .writeFillRect() and .writePixels():

https://github.com/adafruit/Adafruit-GF ... t_SPITFT.h

adafruit_support_mike
 
Posts: 59487
Joined: Thu Feb 11, 2010 2:51 pm

Re: SSD1351 Library Missing Members?

by CodeToad on Sat Jan 12, 2019 7:03 pm

Figured it had to be something along those lines. I convert the demo code I have to use that new class. Thanks for the insight.

CodeToad
 
Posts: 12
Joined: Sat Jan 12, 2019 12:01 am

Please be positive and constructive with your questions and comments.