当前位置:网站首页>STM32 lights up the 1.8-inch screen under Arduino IDE

STM32 lights up the 1.8-inch screen under Arduino IDE

2022-07-05 08:29:00 Sharing master

Premise : I've been using it for two days stm32, Plus screen display , You can't use it directly after looking for a lot of bitterness , It's very unpleasant , Now it can be basically lit , recorded

I bought a piece on Taobao before stm32, Always in the midst of ashes , It looks like this , There was a general yesterday arduino make sense of sth. , For details, please refer to another article (https://blog.csdn.net/yyandad/article/details/105659633)
 Insert picture description here
2、 Because the interface of the development board is different from the general order , So pay attention when buying a screen , I bought this screen at that time , Insert picture description here

3、 The order of screen and development board is the same , The screen pins are shown in the following figure
 Insert picture description here
This is the pin of the development board
 Insert picture description here
4、 Pin sequence
SDA/SDI/MOSI(it means LCD_Model Pin_SDA/SDI/MOSI Connect to Arduino_UNO Pin11)
SCL/CLK/SCLK(it means LCD_Model Pin_SCL/CLK/SCLK Connect to Arduino_UNO Pin10)
CS/CE(it means LCD_Model Pin_CS/CE Connect to Arduino_UNO Pin9)
RST/RESET(it means LCD_Model Pin_RST/RESET Connect to Arduino_UNO Pin12)
RS/DC(it means LCD_Model Pin_RS/DC Connect to Arduino_UNO Pin8)

5、 Library functions used
[1]: https://github.com/adafruit/Adafruit-ST7735-Library
There is no way to use the original library function directly , Refer to the following modifications :
Pin definition and configuration

  #define TFT_MOSI PB15 // Data out
 #define TFT_SCLK PB13 // Clock out
 #define TFT_CS PB12
 #define TFT_DC PB1
 #define TFT_RST PB14`
 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
 

Start point and end point

stay Adafruit_ST77xxx.h Set the starting point in

  `protected:
  uint8_t _colstart = 2,   ///< Some displays need this changed to offset
          _rowstart = 1,       ///< Some displays need this changed to offset
          spiMode = SPI_MODE0; ///< Certain display needs MODE3 instead`

// Set the end point 
#define ST7735_TFTHEIGHT_128 130 // for 1.44" display
#define ST7735_TFTHEIGHT_160 161 // for 1.8" and mini display
原网站

版权声明
本文为[Sharing master]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140544213772.html