標(biāo)題: 16*16點(diǎn)陣顯示你好的仿真和單片機(jī)源碼,學(xué)校簡(jiǎn)單課設(shè) [打印本頁]

作者: 哈嘻    時(shí)間: 2018-7-19 14:14
標(biāo)題: 16*16點(diǎn)陣顯示你好的仿真和單片機(jī)源碼,學(xué)校簡(jiǎn)單課設(shè)
附件是基于單片機(jī)的點(diǎn)陣,很簡(jiǎn)單,需要可直接下載
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


單片機(jī)源程序如下:
  1. #include<reg52.h>
  2. #define  uchar unsigned char
  3. #define  uint unsigned int

  4. uchar code col[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};  

  5. uchar code row[][32]={
  6. {0x80, 0x00,
  7. 0x40, 0x00,
  8. 0xf0, 0x7f,
  9. 0x2c, 0x00,
  10. 0x43, 0x10,
  11. 0x20, 0x0c,
  12. 0x98, 0x03,
  13. 0x0f, 0x21,
  14. 0x0a, 0x40,
  15. 0xe8, 0x3f,
  16. 0x08, 0x00,
  17. 0x88, 0x00,
  18. 0x28, 0x03,
  19. 0x1c, 0x1c,
  20. 0x08, 0x08,
  21. 0x00, 0x00 },    //顯示字碼:你

  22. {0x10, 0x80,
  23. 0x10, 0x43,
  24. 0xf0, 0x22,
  25. 0x1f, 0x14,
  26. 0x10, 0x0c,
  27. 0xf0, 0x73,
  28. 0x80, 0x20,
  29. 0x82, 0x00,
  30. 0x82, 0x40,
  31. 0x82, 0x80,
  32. 0xf2, 0x7f,
  33. 0x8a, 0x00,
  34. 0x86, 0x00,
  35. 0x82, 0x00,
  36. 0x80, 0x00,
  37. 0x00, 0x00}       //顯示字碼:好


  38. };
  39.           

  40. void delayms(uint t)                           //每1延時(shí)1ms
  41. {
  42.      uint x,y;
  43.      for(x=t;x>0;x--)
  44.          for(y=124;y>0;y--);
  45. }                                               

  46. void display(uint n)          //n為顯示字碼的序數(shù)
  47. {
  48.      uint i,j;
  49.          for(j=0;j<10;j++)   
  50.      for(i=0;i<16;i++)
  51.          {
  52.              if(i<8) P2=col[i],P3=0xff;
  53.                  else  P2=0xff, P3=col[i-8];         
  54.              P0=row[n][2*i];
  55.                  P1=row[n][2*i+1];
  56.                  delayms(3);                                   
  57.          }                                  
  58. }                         


  59. void main()
  60. {
  61.      while(1)          
  62.          {
  63.                  display(0);
  64.                  delayms(50);
  65.              display(1);
  66.                  delayms(50);       
  67.          }         
  68. }
  69.                                
復(fù)制代碼

所有資料51hei提供下載:
4(1).rar (46 KB, 下載次數(shù): 18)







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1