欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1700|回復: 0
收起左側

51單片機數碼管循環滾動程序

[復制鏈接]
ID:578163 發表于 2020-3-21 01:13 | 顯示全部樓層 |閱讀模式
本帖最后由 135kor 于 2020-3-21 01:14 編輯

0-a,16位數循環滾動
#include <reg52.h>
#include <MyType.h>
#include <intrins.h>
uint8 code Segment[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
sbit SegSec=P2^6;
sbit PosSec=P2^7;
#define DataPort P0
void Delay(int ms);
void main()
{
uint16 i=0,j,k,x=0xfe;
while(1)
{
   for(j=0;j<23;j++)
   {
    for(i=100;i>0;i--)
    {
     //1
     DataPort=0xfe;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //2
     DataPort=0xfd;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+1];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //3
     DataPort=0xfb;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+2];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //4
     DataPort=0xf7;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+3];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //5
     DataPort=0xef;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+4];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //6
     DataPort=0xdf;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+5];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //7
     DataPort=0xbf;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+6];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
     //8
     DataPort=0x7f;            
     PosSec=1;
     PosSec=0;
     DataPort=Segment[j+7];
     SegSec=1;
     SegSec=0;
     DataPort=0xff;
     Delay(1);
    }
   }
}
}
void Delay(int ms)
{
int i,j;
for(i=ms;i>0;i--)
   for(j=112;j>0;j--);
}

DYLSD6.zip

19.76 KB, 下載次數: 6, 下載積分: 黑幣 -5

回復

使用道具 舉報

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

本版積分規則

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表