Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
uddin-a opened this issue Oct 10, 2021 · 0 comments
Open

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

uddin-a opened this issue Oct 10, 2021 · 0 comments

Comments

@uddin-a
Copy link

uddin-a commented Oct 10, 2021

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() {

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant