标题: 单片机8*8点阵全亮源程序+仿真图 [打印本页]

作者: 12323ff    时间: 2018-4-8 21:16
标题: 单片机8*8点阵全亮源程序+仿真图
广告屏程序+仿真图



单片机源程序如下:
  1. #include <reg52.h>
  2. unsigned char code
  3. tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f} ;
  4. unsigned char code digittab[21][8]={
  5. {0x00,0x7c,0x42,0x42,0x7c,0x40,0x40,0x40},
  6. {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},   //0
  7.          {0x00,0x00,0x3c,0x24,0x24,0x3c,0x00,0x00},   //1
  8.          {0x00,0x7e,0x42,0x42,0x42,0x42,0x7e,0x00},           //2
  9.      {0xff,0x81,0x81,0x81,0x81,0x81,0x81,0xff},           //3
  10.          {0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
  11.          {0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00},
  12.          {0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00},
  13.          {0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00},
  14.          {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff},
  15.          {0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00},
  16.          {0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00},
  17.          {0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00},
  18.          {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80},
  19.          {0x04,0x02,0x01,0x00,0x00,0x80,0x40,0x20},
  20.          {0x10,0x08,0x04,0x82,0x41,0x20,0x10,0x08},
  21.          {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01},
  22.           {0x10,0x08,0x04,0x82,0x41,0x20,0x10,0x08},
  23.            {0x04,0x02,0x01,0x00,0x00,0x80,0x40,0x20},
  24.            {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80},
  25.            {0x00,0x7e,0x81,0x81,0x81,0x81,0x7e,0x00},
  26. };
  27. unsigned int timecount;
  28. unsigned char cnta;
  29. unsigned char cntb;

  30. void main(void)
  31. {
  32. TMOD=0X01;
  33. TH0=(65536-3000)/256;
  34. TL0=(65536-3000)%256;
  35. TR0=1;
  36. ET0=1;
  37. EA=1;
  38. while(1)
  39.    {;
  40.    }
  41. }
  42. void t0(void) interrupt 1 using 0
  43. {
  44. TH0=(65536-3000)/256;
  45. TL0=(65536-3000)%256;
  46. P3=tab[cnta];
  47. P1=digittab[cntb][cnta];
  48. cnta++;
  49. if(cnta==8)
  50. {
  51. cnta=0;
  52. }
  53. timecount++;
  54. if(timecount==333)
  55. {
  56. timecount=0;
  57. cntb++;
  58. if(cntb==21)
  59. {
  60. cntb=0;
  61. }
  62. }
  63. }
复制代码

所有资料51hei提供下载:
广告屏.rar (15.59 KB, 下载次数: 53)

作者: 啊啊啊的    时间: 2018-9-9 10:20
hex要怎么载入?

捕获.PNG (56.35 KB, 下载次数: 64)

捕获.PNG

作者: Admin-51    时间: 2021-9-2 16:51
发现595点不亮
作者: 老当益壮    时间: 2021-9-2 22:07
Admin-51 发表于 2021-9-2 16:51
发现595点不亮

硬件和软件要配套,




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1