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

is the wifi nessasary #1

Open
YosefGoodman opened this issue May 9, 2023 · 5 comments
Open

is the wifi nessasary #1

YosefGoodman opened this issue May 9, 2023 · 5 comments

Comments

@YosefGoodman
Copy link

hi i am having trouble getting this to work on my screen, is the wifi necessary to make the gifs play?

@tobozo
Copy link
Owner

tobozo commented May 9, 2023

hi,

it will not try to fetch files from the network if a /gif folder exist on the sd card and contains gif files

     totalFiles = getGifInventory( "/gif" ); // scan the SD card GIF folder
     if( totalFiles == 0 ) {
         // fetch files via WiFi
     }

@YosefGoodman
Copy link
Author

awesome, is this compatible for an esp32 over an ili9431? do I need to change any parts of the code?

@tobozo
Copy link
Owner

tobozo commented May 9, 2023

yes you need to adjust parts in the code, probably uncomment //#define LGFX_ONLY to expose the display config and edit the pins in the setup:

https://github.com/tobozo/ESP32-GifPlayer/blob/master/ESP32-GifPlayer.ino#L337

@YosefGoodman
Copy link
Author

YosefGoodman commented May 10, 2023

does this look right to you?

#define LGFX_ONLY // enable this for custom board profiles
//#define USE_SPIFFS // requires "Large SPIFFS" partition !!

#if defined LGFX_ONLY
  #include <LGFX_TFT_eSPI.hpp>
  #include <SD.h>
  #define TFCARD_CS_PIN 4 // CS pin for SD Card
  //static lgfx::Touch_XPT2046 touch;
  static lgfx::Panel_ILI9341 panel;
  //static lgfx::Panel_ILI9342 panel;
  static LGFX tft;
  //#define HAS_TOUCH
 and 
 #if defined LGFX_ONLY
    Serial.begin(115200);
    
    auto p = new lgfx::Panel_ILI9341();
    p->spi_3wire = false;
    p->spi_cs    = TFT_CS;  // 14
    p->spi_dc    = TFT_DC;  // 27
    p->gpio_rst  = TFT_RST; // 33
    p->gpio_bl   = TFT_LED; // 32
    p->pwm_ch_bl = 7;

    tft.setPanel(p);
/*
    auto t = new lgfx::Touch_XPT2046(); // sharing SPI with TFT
    t->spi_mosi = MOSI; // 23
    t->spi_miso = MISO; // 19
    t->spi_sclk = SCK;  // 18
    t->spi_cs   = TOUCH_CS; // TOUCH_CS may be custom build spefific ?
    t->spi_host = VSPI_HOST;
    t->bus_shared = true;
    t->freq     = 1600000;

    tft.touch(t);
    

    auto p = new lgfx::Panel_ILI9342;
    p->reverse_invert = true;
    p->spi_3wire = true;
    p->spi_cs =  5;
    p->spi_dc = 15;
    p->rotation = 1;
    p->offset_rotation = 3;

    tft.setPanel(p);
    */
    tft.init();
    //tft.begin();

and where are these named?

    p->spi_cs    = TFT_CS;  // 14
    p->spi_dc    = TFT_DC;  // 27
    p->gpio_rst  = TFT_RST; // 33
    p->gpio_bl   = TFT_LED; // 32
    p->pwm_ch_bl = 7;

is it in a seperate file? or should i remove the "//" to define the pins

@tobozo
Copy link
Owner

tobozo commented May 10, 2023

and where are these named?

 p->spi_cs    = TFT_CS;  // 14
 p->spi_dc    = TFT_DC;  // 27
 p->gpio_rst  = TFT_RST; // 33
 p->gpio_bl   = TFT_LED; // 32
 p->pwm_ch_bl = 7;

nowhere, it's up to you to set the pin values depending on your configuration

There are more extended configuration examples on LovyanGFX repository.

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

2 participants