9 years, 8 months ago.

drawLine?

When I try to use the drawLine method the compiler giv me "Method 'drawLine' could not be resolved"

oled test

#include "mbed.h"
#include "Adafruit_SSD1306.h"


// an I2C sub-class that provides a constructed default
class I2CPreInit : public I2C
{
public:
    I2CPreInit(PinName sda, PinName scl) : I2C(sda, scl)
    {
        frequency(400000);
        start();
    };
};

I2CPreInit gI2C(P0_0,P0_1);

Adafruit_SSD1306_I2c oled(gI2C,p27,0x78,64,128);


int main()
{
  oled.clearDisplay();
  oled.printf("%ux%u OLED Display\r\n", oled.width(), oled.height());
  oled.drawLine(0, h-10, w, h-10, WHITE); // horiz line near bottom  x1,y1, x2,y2, color
 
}

Question relating to:

A derived version of the BSD licensed Adafrut GFX library for the SSD1306 controller for an OLED 128x32 or 128x64 display using SPI or I2C. display, I2C, OLED, SPI, SSD1306

1 Answer

9 years, 8 months ago.

On line 25 you are using variables h and w. Where have you declared and initialised those variables?

yes, I did cut out a lot of code, it doesn't give any other error.

If I move the DrawLine funtion in the SSD1306 library it works, why?

posted by Andrea Campanella 14 Apr 2015