久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 7101|回復: 5
打印 上一主題 下一主題
收起左側

1.8寸 lcd tft顯示屏stm32顯示源碼

[復制鏈接]
跳轉到指定樓層
樓主
ID:141183 發表于 2018-4-24 11:22 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
1.8寸 lcd tft顯示屏 顯示模塊。

單片機源程序如下:
  1. //==================================如何切換橫豎屏顯示=======================================//
  2. //打開Lcd_Driver.h頭文件,修改宏#define USE_HORIZONTAL 值為0使用豎屏模式.1,使用橫屏模式
  3. //===========================如何切換模擬SPI總線驅動和硬件SPI總線驅動=========================//
  4. //打開Lcd_Driver.h頭文件,修改宏#define USE_HARDWARE_SPI  值為0使用模擬SPI總線.1,使用硬件SPI總線
  5. /*Voltage[4]:電壓
  6. *I_current[4]:電流
  7. *direction[4]:方向
  8. *speed[4]:速度
  9. *temperature[4]:溫度*/
  10. /* Includes ------------------------------------------------------------------*/
  11. #include "stm32f10x.h"
  12. #include "Lcd_Driver.h"
  13. #include "LCD_Config.h"
  14. #include "GUI.h"
  15. #include "delay.h"
  16. #include "Picture.h"
  17. #define  uint   unsigned int
  18. #define  uchar  unsigned char


  19. GPIO_InitTypeDef GPIO_InitStructure;
  20. void RCC_Configuration(void);
  21. void Delayms(__IO uint32_t nCount);
  22. uchar Num[10]={0,1,2,3,4,5,6,7,8,9};
  23. uchar number[4],nnn=100;
  24. uchar Voltage[4],I_current[4],direction[4],speed[4],temperature[4];

  25. void Redraw_Mainmenu(void)
  26. {

  27.         Lcd_Clear(GRAY0);
  28.         
  29.         Gui_DrawFont_GBK16(16,2,BLUE,GRAY0,"后備保護系統");

  30.         DisplayButtonUp(15,26,113,50); //x1,y1,x2,y2        
  31.         Gui_DrawFont_GBK16(15,30,RED,GRAY0,"電流:");
  32.         sprintf(I_current ,"%d",nnn);
  33.   Gui_DrawFont_GBK16(54, 30, RED, GRAY0,I_current);
  34.                 Gui_DrawFont_GBK16(92,30,RED,GRAY0,"A");
  35.         
  36.         DisplayButtonUp(15,51,113,75); //x1,y1,x2,y2
  37.         Gui_DrawFont_GBK16(16,55,RED,GRAY0,"電壓:");
  38.         sprintf(Voltage,"%d",nnn);
  39.   Gui_DrawFont_GBK16(54, 55, RED, GRAY0,Voltage);
  40.         Gui_DrawFont_GBK16(92,55,RED,GRAY0,"V");
  41.         
  42.         DisplayButtonUp(15,76,113,100); //x1,y1,x2,y2
  43.         Gui_DrawFont_GBK16(16,80,RED,GRAY0,"方向:");
  44.         Gui_DrawFont_GBK16(54,80,RED,GRAY0,"上行");
  45.         
  46.         DisplayButtonUp(15,101,113,125); //x1,y1,x2,y2
  47.         Gui_DrawFont_GBK16(16,105,RED,GRAY0,"轉速:");
  48.         sprintf(speed,"%d",nnn);
  49.   Gui_DrawFont_GBK16(54, 105, RED, GRAY0,speed);
  50.         Gui_DrawFont_GBK16(84,105,RED,GRAY0,"m/s");
  51.         
  52.         DisplayButtonUp(15,126,113,150); //x1,y1,x2,y2
  53.         Gui_DrawFont_GBK16(16,130,RED,GRAY0,"溫度:");
  54.         sprintf(temperature,"%d",nnn);
  55.   Gui_DrawFont_GBK16(54, 130, RED, GRAY0,temperature);        
  56.         Gui_DrawFont_GBK16(92,130,RED,GRAY0,"度");        
  57. }


  58. //u16 ID=0;

  59. int main(void)
  60. {
  61.   SystemInit();
  62.   delay_init(72);//延時初始化
  63.   Lcd_Init();//初始化硬件SPI
  64.         
  65.         Redraw_Mainmenu();        
  66.         
  67.         
  68.   while(1)
  69.   {  

  70.   }

  71. }


  72. //void RCC_Configuration(void)
  73. //{   
  74. //  /* 設置微控制器系統,初始化嵌入式FLASH接口,初始化PLL并更新系統頻率變量 */
  75. //  SystemInit();
  76. //}


  77. void Delayms(__IO uint32_t nCount)
  78. {
  79.   for(; nCount != 0; nCount--);
  80. }

  81. #ifdef  USE_FULL_ASSERT
  82. /**
  83.   * @brief  Reports the name of the source file and the source line number
  84.   *   where the assert_param error has occurred.
  85.   * @param file: pointer to the source file name
  86.   * @param line: assert_param error line source number
  87.   * @retval : None
  88.   */



  89. void assert_failed(uint8_t* file, uint32_t line)
  90. ……………………

  91. …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼

所有資料51hei提供下載:
顯示.rar (368.75 KB, 下載次數: 171)


評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:214152 發表于 2018-7-4 13:58 | 只看該作者
看看,感謝分享
回復

使用道具 舉報

板凳
ID:413217 發表于 2018-10-22 10:28 | 只看該作者
你好,能告訴下怎么接線嗎
回復

使用道具 舉報

地板
ID:141183 發表于 2019-2-23 10:52 | 只看該作者
411706683 發表于 2018-10-22 10:28
你好,能告訴下怎么接線嗎

//±¾2aêÔ3ìDòê1óÃμÄêÇÄ£ÄaSPI½ó¿úÇy¶ˉ
//¿é×Ôóé¸ü¸Ä½ó¿úIOÅäÖã¬ê1óÃèÎòa×îéù4 IO¼′¿éíê3é±¾¿îòo¾§Çy¶ˉÏÔê¾
/******************************************************************************
½ó¿ú¶¨òåÔúLcd_Driver.hÄú¶¨ò壬Çë¸ù¾Y½óÏßDT¸Ä2¢DT¸ÄÏàó|IO3õê¼»ˉLCD_GPIO_Init()
#define LCD_CTRL                     GPIOB                     //¶¨òåTFTêy¾Y¶Ë¿ú
#define LCD_LED                             //2»ê1óñ31a¿ØÖÆ
#define LCD_RS                 GPIO_Pin_1         //PB1--->>TFT --RS/DC
#define LCD_CS                GPIO_Pin_12  //PB11--->>TFT --CS/CE
#define LCD_RST                                        //¸′λòy½Å½óμ½Ïμí3¸′λéÏ
#define LCD_SCL                GPIO_Pin_13         //PB13--->>TFT --SCL/SCK
#define LCD_SDA                GPIO_Pin_15         //PB15 MOSI--->>TFT --SDA/DIN
*******************************************************************************/
回復

使用道具 舉報

5#
ID:688355 發表于 2020-2-20 15:06 | 只看該作者
非常感謝,下來試試學習一下
回復

使用道具 舉報

6#
ID:74868 發表于 2021-1-14 09:15 | 只看該作者
分享快樂
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 国产一区二区小视频 | 精品国产乱码久久久久久丨区2区 | 欧美成人一级 | 国产精品久久久久久久久久免费看 | 亚洲一区视频在线 | 超碰成人在线观看 | 97精品超碰一区二区三区 | 91免费看片 | 久久久免费 | 999国产精品视频免费 | 国产精品国产精品国产专区不片 | 欧美黑人狂野猛交老妇 | 久草综合在线视频 | 久久久久国产精品午夜一区 | 久久99久久99 | 亚洲+变态+欧美+另类+精品 | 午夜码电影 | 久久久久久久国产 | 国产高清在线精品一区二区三区 | 久久综合九色综合欧美狠狠 | 欧美99| 秋霞a级毛片在线看 | xxxcom在线观看| 国产精品永久久久久 | 日韩有码一区二区三区 | 午夜av电影 | 中文日韩字幕 | 中文字幕一区二区三区日韩精品 | 99综合 | 亚洲一区二区中文字幕 | 成人黄色在线 | 免费看黄色小视频 | 国产精品www| 欧美成人a | 国产在线精品一区二区 | 涩涩鲁亚洲精品一区二区 | 久久婷婷av | 一区二区福利视频 | 日本电影免费完整观看 | 在线一区 | 亚洲精品在线视频 |