本帖最后由 135kor 于 2020-3-21 01:14 编辑
0-a,16位数循环滚动
#include
#include
#include
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;