Skip to content

solution for : epd290bw not declared for AVR arduino devices #16

Description

@uddin-a

When we are trying the example DEPG0290BxS75AFxX_BW.ino the compiler gives us the following error

/home/####/Arduino/libraries/e-ink-master/examples/DEPG0290BxS75AFxX_BW/DEPG0290BxS75AFxX_BW.ino: In function 'void setup()':
DEPG0290BxS75AFxX_BW:38:5: error: 'epd290bw' was not declared in this scope
   38 |     epd290bw.EPD_Init(); //Electronic paper initialization
      |     ^~~~~~~~
exit status 1
'epd290bw' was not declared in this scope

after a quick review, we can see that in the third elif for AVR devices (line 29) the object DEPG0290BxS75AFxX_BW epd290bw was not declared which created the error.

To fix the error I have added the declaration of the object and added the CLK_PIN to 13

Here is what the file looks like after the change :

/*
DEPG0290BxS75AFxX_BW is a 2.9 inch black and white screen
Display Resolution 128(H)×296(V)
*/
#include "DEPG0290BxS75AFxX_BW.h"
#include "picture.h"

#define UNDEFINED -1
#ifdef CubeCell_Board //AB01
    #define FREQUENCY 2000000

    DEPG0290BxS75AFxX_BW epd290bw(GPIO1, GPIO2, GPIO3, GPIO5, UNDEFINED, SPI_NUM_0, FREQUENCY);//reset_pin, dc_pin, cs_pin, busy_pin, clk_pin, spi_num, frequency
#elif defined( ESP32 )
    #define RST_PIN         16
    #define DC_PIN          22
    #define CS_PIN          18
    #define BUSY_PIN        23
    #define CLK_PIN         5

    DEPG0290BxS75AFxX_BW epd290bw(RST_PIN, DC_PIN, CS_PIN, BUSY_PIN, CLK_PIN);//reset_pin, dc_pin, cs_pin, busy_pin, clk_pin
#elif defined( ESP8266 )
    #define RST_PIN         16
    #define DC_PIN          4
    #define CS_PIN          15
    #define BUSY_PIN        5
    #define CLK_PIN         14

    DEPG0290BxS75AFxX_BW epd290bw(RST_PIN, DC_PIN, CS_PIN, BUSY_PIN, CLK_PIN);//reset_pin, dc_pin, cs_pin, busy_pin, clk_pin
#elif defined ( AVR )
    #define RST_PIN         8
    #define DC_PIN          9
    #define CS_PIN          10
    #define BUSY_PIN        7
    #define CLK_PIN         13
    //#define SDI             11 // Pin MOSI

    DEPG0290BxS75AFxX_BW epd290bw(RST_PIN, DC_PIN, CS_PIN, BUSY_PIN, CLK_PIN);//reset_pin, dc_pin, cs_pin, busy_pin, clk_pin
#endif

void setup() {
    Serial.begin(115200);
    epd290bw.EPD_Init(); //Electronic paper initialization
    epd290bw.EPD_ALL_image(gImage_290image_bw);	//Refresh the picture in full screen

    // delay(1000);
    // epd290bw.EPD_WhiteScreen_Black();
    // delay(1000);
    // epd290bw.EPD_WhiteScreen_White();
    epd290bw.EPD_DeepSleep();  //Enter deep sleep	

}
void loop() {

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions