Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
976 stars 229 forks source link

ESP-32 radio #46

Open digits1 opened 7 years ago

digits1 commented 7 years ago

PROMT Hello! I very much like the project of radio on esp32. I have such question. Why only ili9163? With other lcd, for example St7735 will be options? Thanks.

Edzelf commented 7 years ago

There are only a few lines of code for the display. It should be easy to replace them with the code for any display.

derpicknicker1 commented 6 years ago

To do this, do the following:

  1. Get the lib for ST7735 here or install it with Library Manager (search for Adafruit_ST7735)

  2. Include the header file for ST7735 instead of ILI9163. Change #include <TFT_ILI9163C.h> to #include <Adafruit_ST7735.h> in Line 105

  3. Change lines 115 to 118 to look like this:

    #define BLACK   ST7735_BLACK
    #define BLUE    ST7735_BLUE
    #define RED     ST7735_RED
    #define GREEN   ST7735_GREEN
  4. Change line 224 from TFT_ILI9163C* tft = NULL ; to Adafruit_ST7735* tft = NULL ;

  5. Change lines 2763 to 2766 which will look like this

    tft = new TFT_ILI9163C ( ini_block.tft_cs_pin,
                             ini_block.tft_dc_pin ) ;    
    tft->begin() ;                                   
    tft->fillRect ( 0, 0, 160, 128, BLACK ) ; 

to the following:

    tft = new Adafruit_ST7735 ( ini_block.tft_cs_pin,
                             ini_block.tft_dc_pin, 0 ) ;    
    tft->initR(INITR_BLACKTAB);                                      
    tft->fillScreen(BLACK);
  1. Delete line 2768 which is tft->clearScreen() ;

Thats all.