找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 6915|回復(fù): 2
打印 上一主題 下一主題
收起左側(cè)

stm32單片機(jī)控制迪文串口屏源代碼

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:320115 發(fā)表于 2018-5-1 22:23 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
迪文屏控制例子

單片機(jī)源程序如下:
  1. #include "stm32f10x.h"
  2. #include "stm32f10x_it.h"
  3. #include "led1.h"
  4. #include "USART.h"
  5. //#include "stm32f10x_it.h"

  6. #define LED_1                         GPIO_Pin_6              /*DS1使用的GPIO管腳*/
  7. #define LED_2                         GPIO_Pin_7                                /*DS2使用的GPIO管腳*/
  8. extern unsigned char KeyStop_Flag;
  9. unsigned char ii;
  10. extern unsigned int RxBuffer1[8];
  11. //unsigned char rec[10];
  12. unsigned char pic[3]={0xAA,0x70,0x00};           //圖片顯示
  13. unsigned char end[4]={0xCC,0x33,0xC3,0x3C};                         //結(jié)束標(biāo)志
  14. //unsigned char color[6]={0xAA,0x40,0xF8,0x00,0x00,0x1F};           //設(shè)置當(dāng)前調(diào)色板
  15. //unsigned char qiewb[15]={0xAA,0x71,0,0x00,0x00,0x01,0xB5,0x02,0x80,0x01,0xE0,0x00,0x00,0x01,0xB5}; //剪切圖片顯示

  16. void Delay(vu32 nCount);

  17. void en(void)
  18. {
  19.                 USART1WriteDat(end,4);       
  20. }

  21. int main(void)
  22. {       
  23.         BSP_LED_Init();
  24.     USART_Configuration();
  25.         NVIC_Configuration();
  26.     ii=0;
  27. //        BSP_LED_On();
  28. //        BSP_LED_Init(LED_2);
  29.     while(1)
  30.         {
  31.         //        USART1_Putc(0x06);
  32.         //        USART1_Puts("yanghai haha\n");
  33.             if(KeyStop_Flag==0)
  34.                 {
  35.                     pic[2]=ii;
  36.                     USART1WriteDat(pic,3);
  37.                         en();
  38.                         ii++;
  39.                         if(ii==13)
  40.                         {
  41.                             ii=0;
  42.                         }
  43.                 }
  44.                 //while(KeyStop_Flag);
  45.                 BSP_LED_Off();
  46.                 Delay(0x4FFFFF);
  47.                 BSP_LED_On();
  48.                 Delay(0x4FFFFF);         
  49.                
  50.         }
  51. }

  52. /*******************************************************************************
  53. * Function Name  : Delay
  54. ……………………

  55. …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼

所有資料51hei提供下載:
stm32 control deven LCD.rar (28.39 KB, 下載次數(shù): 131)


評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

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

使用道具 舉報(bào)

沙發(fā)
ID:94642 發(fā)表于 2018-12-3 17:07 | 只看該作者
你的代碼都編譯不過,你怎么能發(fā)過呢,這不是坑人嗎
回復(fù)

使用道具 舉報(bào)

板凳
ID:94642 發(fā)表于 2018-12-3 17:07 | 只看該作者
你發(fā)之前能不能先自己驗(yàn)證一下啊,
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

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

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表