根据数码管和流水灯显示时间,温度等。流水灯有多种样式。
单片机源程序如下:
- #include "STC15F2K.h"
- #include "intrins.h"
- #include <math.h>
- #define uchar unsigned char
- #define uint unsigned int
- sfr ADC_LOW2 = 0xBE; //ADC低2位结果
- #define ADC_POWER 0x80 //ADC电源控制位
- #define ADC_FLAG 0x10 //ADC完成标志
- #define ADC_START 0x08 //ADC起始控制位
- #define ADC_SPEEDLL 0x00 //540个时钟
- #define ADC_SPEEDL 0x20 //360个时钟
- #define ADC_SPEEDH 0x40 //180个时钟
- #define ADC_SPEEDHH 0x60 //90个时钟
- sbit S1=P3^3;
- sbit S2=P3^4;
- sbit S3=P3^5;
- sbit S4=P3^6;
- sbit S5=P3^7;
- sbit S6=P1^2;
- sbit S7=P1^3;
- sbit S8=P1^4;
- sbit S9=P1^5;
- sbit S10=P1^6;
- sbit S11=P1^7;
- sbit S12=P5^4;
- sbit bell=P3^0;
- sbit set=P1^0;
- sbit jia=P1^1;
- uchar dat1[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xf8,0X80,0X90,0xff,0xc6};
- uchar dat2[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0X00,0X10,0xff};//有小数点
- uchar dat3[9]={0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};//
- uchar dat4[9]={0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};//
- uchar t_led0[8]={0};
- uchar t_led1[8]={0};
- uchar table[4]={1,2,3,4};
- uchar xg=0;
- char t=0;
- int t1;
- char ps=0;
- char flag=1;
- int sudu1=0,sudu2=0;
- unsigned int temp[2];
- int ld;
- extern void init_ds1302_io();
- extern void init_ds1302();
- extern void read_time();
- extern void write_time();
- extern void read_nao();
- extern uchar miao;
- extern uchar fen;
- extern uchar shi;
- extern uchar nfen;
- extern uchar nshi;
- void Delayms(uint t)
- {
- uchar i;
- while(t--)
- for(i=0;i<100;i++);
- }
- void display()
- {
- S12=0;S1=1;
- P2=dat1[table[0]];
- Delayms(2);
- S1=0;S2=1;
- if(flag==0)P2=dat2[table[1]];
- if(flag==1)P2=dat1[table[1]];
- Delayms(2);
-
- S2=0;S3=1;
- P2=dat1[table[2]];
- Delayms(2);
-
- S3=0;S4=1;
- P2=dat1[table[3]];
- Delayms(2);
- //////////////////////////////////////////////////////
- P2=0xff;
- S4=0;S5=1;
- P2=dat3[t_led0[0]]&dat4[t_led1[0]];
- Delayms(2);
- P2=0xff;
- S5=0;S6=1;
- P2=dat3[t_led0[1]]&dat4[t_led1[1]];
- Delayms(2);
- P2=0xff;
- S6=0;S7=1;
- P2=dat3[t_led0[2]]&dat4[t_led1[2]];
- Delayms(2);
- P2=0xff;
- S7=0;S8=1;
- P2=dat3[t_led0[3]]&dat4[t_led1[3]];
- Delayms(2);
- P2=0xff;
- S8=0;S9=1;
- P2=dat3[t_led0[4]]&dat4[t_led1[4]];
- Delayms(2);
- P2=0xff;
- S9=0;S10=1;
- P2=dat3[t_led0[5]]&dat4[t_led1[5]];
- Delayms(2);
- P2=0xff;
- S10=0;S11=1;
- P2=dat3[t_led0[6]]&dat4[t_led1[6]];
- Delayms(2);
- P2=0xff;
- S11=0;S12=1;
- P2=dat3[t_led0[7]]&dat4[t_led1[7]];
- Delayms(2);
- S1=S2=S3=S4=S5=S6=S7=S8=S9=S10=S11=S12=1;
- P2=0xff;
- S1=S2=S3=S4=S5=S6=S7=S8=S9=S10=S11=S12=0;
- Delayms(2);
- }
- void init()
- {
- TMOD= 0x01;
- TL0 = (65536-20000)/256; //设置定时初值
- TH0 = (65536-20000)%256; //设置定时初值
- ET0 = 1;
- TR0 = 1;
- EA = 1;
- }
- char menu=0;
- bit nf=0;
- bit gk=0;
- void key()
- {
- uchar i;
- if(jia==0 && menu==0)
- {
- while(jia==0);
- xg++;
- nf=0;
- if(xg==2){dat4[0]=0XFF;dat4[1]=0XFF;dat4[2]=0XFF;dat4[3]=0XFF;dat4[4]=0XFF;dat4[5]=0XFF;dat4[6]=0XFF;dat4[7]=0XFF;dat4[8]=0XFF;}
- if(xg==3){dat3[0]=0xFE;dat3[1]=0xFC;dat3[2]=0xF8;dat3[3]=0xF0;dat3[4]=0xE0;dat3[5]=0xC0;dat3[6]=0x80;dat3[7]=0x00;dat3[8]=0xFF;}
-
- if(xg==5)
- {
- sudu1=0;sudu2=0;
- for(i=0;i<9;i++)
- {
- //dat3[i]=0XFF;
- dat4[i]=0XFE;
- }
- dat3[0]=0X01;dat3[1]=0X03;dat3[2]=0X07;dat3[3]=0X0F;dat3[4]=0X1F;dat3[5]=0X3F;dat3[6]=0X7F;dat3[7]=0XFF;dat3[8]=0x00;
- }
- if(xg==6)
- {
- sudu1=0;sudu2=0;
- for(i=0;i<9;i++)
- {
- dat3[i]=0XFF;
- dat4[i]=0XFC;
- }
- for(i=0;i<8;i++){t_led0[i]=8;}
- for(i=0;i<8;i++){t_led1[i]=0;}
- }
- if(xg==7)
- {
- sudu1=0;sudu2=0;
- for(i=0;i<9;i++)
- {
- dat3[i]=0XFF;
- dat4[i]=0XFF;
- }
- for(i=0;i<8;i++){t_led0[i]=i;}
- for(i=0;i<8;i++){t_led1[i]=i;}
- }
- if(xg==8)
- {
- sudu1=0;sudu2=0;
- for(i=0;i<9;i++)
- {
- dat3[i]=0XFF;
- dat4[i]=0XFF;
- }
- }
- if(xg==9)
- {
- sudu1=0;sudu2=0;
- for(i=0;i<9;i++)
- {
- dat3[i]=0XFF;
- dat4[i]=0XFF;
- }
- }
- if(xg==10){xg=0;for(i=0;i<9;i++)dat4[i]=0XFF;}
- }
- if(set==0)
- {
- bell=0;
- menu++;
- if(menu==3){read_nao();}
- if(menu==7){menu=0;ET1 = 1;write_time();}
- while(set==0);
- bell=1;
- }
- if(menu==1)
- {
- if(jia==0)
- {
- bell=0;
- if(fen >= 0x60)
- fen = 0;
- fen=fen+0x01;
- if((fen & 0x0f) >= 0x0a)
- fen = (fen & 0xf0) + 0x10;
- while(jia==0);
- bell=1;
- }
- }
- if(menu==2)
- {
- if(jia==0)
- {
- bell=0;
- shi+=0x01;
- if((shi & 0x0f) >= 0x0a)
- shi = (shi & 0xf0) + 0x10;
- if(shi >= 0x24)
- shi = 0;
- while(jia==0);
- bell=1;
- }
- }
-
- if(menu==3) //闹钟
- {
- if(jia==0)
- {
- bell=0;
- if(nfen >= 0x60)
- nfen = 0;
- nfen=nfen+0x01;
- if((nfen & 0x0f) >= 0x0a)
- nfen = (nfen & 0xf0) + 0x10;
- while(jia==0);
- bell=1;
- }
- }
- if(menu==4)
- {
- if(jia==0)
- {
- bell=0;
- nshi+=0x01;
- if((nshi & 0x0f) >= 0x0a)
- nshi = (nshi & 0xf0) + 0x10;
- if(nshi >= 0x24)
- nshi = 0;
- while(jia==0);
- bell=1;
- }
- }
- if(menu==5)
- {
- if(jia==0)
- {
- while(jia==0);
- nf=!nf;
- }
- }
- if(menu==6)
- {
- if(jia==0)
- {
- while(jia==0);
- gk=!gk;
- }
- }
- }
- void InitADC()
- {
- P1ASF = 0x03; //Open channels ADC function 0100 0000 p1.6使用AD功能
- ADC_RES = 0; //Clear previous result
- ADC_LOW2 = 0;
- ADC_CONTR = ADC_POWER | ADC_SPEEDLL;
- }
- void GetADCResult(unsigned char ch,unsigned int *value)
- {
- ADC_CONTR = ADC_POWER | ADC_SPEEDLL | ch | ADC_START;
- _nop_(); //Must wait before inquiry
- _nop_();
- _nop_();
- _nop_();
- _nop_(); //Must wait before inquiry
- _nop_();
- while(!(ADC_CONTR & ADC_FLAG));//Wait complete flag
- ADC_CONTR &= ~ADC_FLAG; //Close ADC
- *value = 0;
- *value = ADC_RES;
- *value = ((*value)*4 + ADC_LOW2); //Return ADC result.×¢êíμ?′????ò·μ??8??ADC?á1?
- }
- void ADC_convert(void)
- {
- GetADCResult(0,&temp[0]);
- temp[0] = (unsigned int) ( ( 3950.0 / ( 11.33657 + log( 6.04 * (float)temp[0] / ( 1024.0 - (float)temp[0] ) ) ) - 278.15) * 100 );
- }
- void main()
- {
- uchar i;
- init();
- InitADC();
- init_ds1302_io();
- init_ds1302();
- read_nao();
- P3M0=0xf8;P3M1=0x00;
- P2M0=0xff;P2M1=0x00;
- P1M0=0xff;P1M1=0x00;
- P5M0=0x10;P5M1=0x00;
- while(1)
- {
- P1ASF = 0x00;
- key();
- P1ASF = 0x03;
- if(menu==0)
- {
- read_time();
- if(t1>25 && t1<30)
- {
- ADC_convert();
- flag=1;
- table[0]=10;
- table[1]=temp[0]/1000;
- table[2]=temp[0]%1000/100;
- table[3]=11;
- }
- if(t1>0 && t1<25)
- {
- table[0]=shi/16;
- table[1]=shi%16;
- table[2]=fen/16;
- table[3]=fen%16;
- }
- if(t1>30)t1=0;
- if(xg==0)
- {
- dat3[0]=0xFE;dat3[1]=0xFD;dat3[2]=0xFB;dat3[3]=0xF7;dat3[4]=0xEF;dat3[5]=0xDF;dat3[6]=0xBF;dat3[7]=0x7F;dat3[8]=0xFF;
- for(i=0;i<8;i++)t_led0[i]=8;
- for(i=0;i<8;i++)t_led1[i]=8;
- }
- if(xg==1)
- {
- dat4[0]=0XEF;dat4[1]=0XBD;dat4[2]=0XF7;dat4[3]=0XDE;dat4[4]=0X7B;dat4[5]=0XEF;dat4[6]=0XBD;dat4[7]=0X07;
- for(i=0;i<8;i++)t_led1[i]=i;
- dat3[0]=0xFE;dat3[1]=0xFD;dat3[2]=0xFB;dat3[3]=0xF7;dat3[4]=0xEF;dat3[5]=0xDF;dat3[6]=0xBF;dat3[7]=0x7F;dat3[8]=0xFF;
- for(i=0;i<8;i++)t_led0[i]=8;
- }
-
- if(xg==2)
- {
- dat3[0]=0x01;dat3[1]=0x02;dat3[2]=0x04;dat3[3]=0x08;dat3[4]=0x10;dat3[5]=0x20;dat3[6]=0x40;dat3[7]=0x80;dat3[8]=0x00;
- for(i=0;i<8;i++)t_led0[i]=8;
- }
- if(xg==3)
- {
- if(miao==0x01)for(i=0;i<8;i++){t_led0[i]=8;}
- if(miao>0x08){t_led0[0]=7;}
- if(miao>0x16){t_led0[1]=7;}
- if(miao>0x24){t_led0[2]=7;}
- if(miao>0x32){t_led0[3]=7;}
- if(miao>0x40){t_led0[4]=7;}
- if(miao>0x48){t_led0[5]=7;}
- if(miao>0x56){t_led0[6]=7;}
- }
- if(xg==4)
- {
- dat4[0]=0XEF;dat4[1]=0XBD;dat4[2]=0XF7;dat4[3]=0XDE;dat4[4]=0X7B;dat4[5]=0XEF;dat4[6]=0XBD;dat4[7]=0X07;
- }
- if(xg==5)
- {
- if(miao==0x01)for(i=0;i<8;i++){t_led0[i]=8;}
- if(miao>0x08){t_led0[0]=7;}
- if(miao>0x16){t_led0[1]=7;}
- if(miao>0x24){t_led0[2]=7;}
- if(miao>0x32){t_led0[3]=7;}
- if(miao>0x40){t_led0[4]=7;}
- if(miao>0x48){t_led0[5]=7;}
- if(miao>0x56){t_led0[6]=7;}
- }
- if(xg<6)
- {
- if(miao==0x01)t_led0[0]=0;
- if(miao==0x02)t_led0[0]=1;
- if(miao==0x03)t_led0[0]=2;
- if(miao==0x04)t_led0[0]=3;
- if(miao==0x05)t_led0[0]=4;
- if(miao==0x06)t_led0[0]=5;
- if(miao==0x07)t_led0[0]=6;
- if(miao==0x08)t_led0[0]=7;
-
- if(miao==0x09)t_led0[1]=0;
- if(miao==0x10)t_led0[1]=1;
- if(miao==0x11)t_led0[1]=2;
- if(miao==0x12)t_led0[1]=3;
- if(miao==0x13)t_led0[1]=4;
- if(miao==0x14)t_led0[1]=5;
- if(miao==0x15)t_led0[1]=6;
- if(miao==0x16)t_led0[1]=7;
-
- if(miao==0x17)t_led0[2]=0;
- if(miao==0x18)t_led0[2]=1;
- if(miao==0x19)t_led0[2]=2;
- if(miao==0x20)t_led0[2]=3;
- if(miao==0x21)t_led0[2]=4;
- if(miao==0x22)t_led0[2]=5;
- if(miao==0x23)t_led0[2]=6;
- if(miao==0x24)t_led0[2]=7;
-
- if(miao==0x25)t_led0[3]=0;
- if(miao==0x26)t_led0[3]=1;
- if(miao==0x27)t_led0[3]=2;
- if(miao==0x28)t_led0[3]=3;
- if(miao==0x29)t_led0[3]=4;
- if(miao==0x30)t_led0[3]=5;
- if(miao==0x31)t_led0[3]=6;
- if(miao==0x32)t_led0[3]=7;
-
- if(miao==0x33)t_led0[4]=0;
- if(miao==0x34)t_led0[4]=1;
- if(miao==0x35)t_led0[4]=2;
- if(miao==0x36)t_led0[4]=3;
- if(miao==0x37)t_led0[4]=4;
- if(miao==0x38)t_led0[4]=5;
- if(miao==0x39)t_led0[4]=6;
- if(miao==0x40)t_led0[4]=7;
-
- if(miao==0x41)t_led0[5]=0;
- if(miao==0x42)t_led0[5]=1;
- if(miao==0x43)t_led0[5]=2;
- if(miao==0x44)t_led0[5]=3;
- if(miao==0x45)t_led0[5]=4;
- if(miao==0x46)t_led0[5]=5;
- if(miao==0x47)t_led0[5]=6;
- if(miao==0x48)t_led0[5]=7;
-
- if(miao==0x49)t_led0[6]=0;
- if(miao==0x50)t_led0[6]=1;
- if(miao==0x51)t_led0[6]=2;
- if(miao==0x52)t_led0[6]=3;
- if(miao==0x53)t_led0[6]=4;
- if(miao==0x54)t_led0[6]=5;
- if(miao==0x55)t_led0[6]=6;
- if(miao==0x56)t_led0[6]=7;
-
- if(miao==0x57)t_led0[7]=0;
- if(miao==0x58)t_led0[7]=1;
- if(miao==0x59)t_led0[7]=2;
- if(miao==0x00)t_led0[7]=3;
- }
- }
- if(menu==1)
- {
- if(flag>0)
- {
- table[2]=fen/16;
- table[3]=fen%16;
- }
- else
- {
- table[2]=10;
- table[3]=10;
- }
- table[0]=shi/16;
- table[1]=shi%16;
- }
- if(menu==2)
- {
- table[2]=fen/16;
- table[3]=fen%16;
- if(flag>0)
- {
- table[0]=shi/16;
- table[1]=shi%16;
- }
- else
- {
- table[0]=10;
- table[1]=10;
- }
- }
- if(menu==3)
- {
- if(flag>0)
- {
- table[2]=nfen/16;
- table[3]=nfen%16;
- }
- else
- {
- table[2]=10;
- table[3]=10;
- }
- table[0]=nshi/16;
- table[1]=nshi%16;
- }
- if(menu==4)
- {
- table[2]=nfen/16;
- table[3]=nfen%16;
- if(flag>0)
- {
- table[0]=nshi/16;
- table[1]=nshi%16;
- }
- else
- {
- table[0]=10;
- table[1]=10;
- }
- }
- if(menu==5)
- {
- table[0]=nf;
- table[1]=nf;
- table[2]=nf;
- table[3]=nf;
- }
- if(menu==6)
- {
- table[0]=gk;
- table[1]=gk;
- table[2]=gk;
- table[3]=gk;
- }
- if(gk==1)//开光控
- {
- GetADCResult(1,&temp[1]);
- if( temp[1]<100)ld=8;
- if( temp[1]>100 && temp[1]<300)ld=10;
- if( temp[1]>300 && temp[1]<500)ld=30;
- if( temp[1]>500 && temp[1]<600)ld=90;
- if( temp[1]>600 && temp[1]<700)ld=120;
- if( temp[1]>700 && temp[1]<800)ld=150;
- if( temp[1]>800 && temp[1]<900)ld=180;
- if( temp[1]>900)ld=200;
- }
- else ld=8;
- display();
- Delayms(ld);
- }
- }
- char count=10,bc=0;
- void InitTimer1() interrupt 1 // 1毫秒@11.0592MHz
- {
- TL0 = (65536-20000)/256; //设置定时初值
- TH0 = (65536-20000)%256; //设置定时初值
- t++;
- if(t==40)
- {
- t=0;
- t1++;
- if(menu==0){if(t1>0 && t1<25)flag=!flag;else flag=1;}
- if(menu==1 || menu==2 || menu==3 || menu==4) flag=!flag;
- if(menu==5 || menu==6)flag=1;
- if(nf==1)if(shi==nshi && fen==nfen)bell=!bell;
- else bell=1;
- }
-
- if(xg==5)
- {
- sudu2++;
- if(sudu2==7)
- {
- sudu2=0;
- sudu1++;
-
- dat4[0]=(dat4[0]>>1)|0x80;
- dat4[1]=(dat4[1]>>1)|0x80;
- dat4[2]=(dat4[2]>>1)|0x80;
- dat4[3]=(dat4[3]>>1)|0x80;
- dat4[4]=(dat4[4]>>1)|0x80;
- dat4[5]=(dat4[5]>>1)|0x80;
- dat4[6]=(dat4[6]>>1)|0x80;
- dat4[7]=(dat4[7]>>1)|0x80;
- if(sudu1==8){sudu1=0;dat4[0]=0X7F;dat4[1]=0X7F;dat4[2]=0X7F;dat4[3]=0X7F;dat4[4]=0X7F;dat4[5]=0X7F;dat4[6]=0X7F;dat4[7]=0X7F;}
- }
- }
- if(xg==6)
- {
- sudu2++;
- if(sudu2==4)
- {
- sudu2=0;
- sudu1++;
- dat4[0]=(dat4[0]<<1)|0x01;
- dat4[1]=(dat4[1]<<1)|0x01;
- dat4[2]=(dat4[2]<<1)|0x01;
- dat4[3]=(dat4[3]<<1)|0x01;
- dat4[4]=(dat4[4]<<1)|0x01;
- dat4[5]=(dat4[5]<<1)|0x01;
- dat4[6]=(dat4[6]<<1)|0x01;
- dat4[7]=(dat4[7]<<1)|0x01;
- if(sudu1==8){sudu1=0;dat4[0]=0XFC;dat4[1]=0XFC;dat4[2]=0XFC;dat4[3]=0XFC;dat4[4]=0XFC;dat4[5]=0XFC;dat4[6]=0XFC;dat4[7]=0XFC;}
- }
- }
- if(xg==7)
- {
- sudu2++;
- if(sudu2==count)
- {
- sudu2=0;
- sudu1++;
- if(sudu1==1){dat4[0]=0xfe;dat4[7]=0xfb;}
- if(sudu1==2){dat4[0]=0xfd;dat4[7]=0xfd;}
- if(sudu1==3){dat4[0]=0xfb;dat4[7]=0xfe;}
- if(sudu1==4){dat4[0]=0xf7;dat4[7]=0xff;dat4[6]=0x7f;}
- if(sudu1==5){dat4[0]=0xef;dat4[6]=0xbf;}
- if(sudu1==6){dat4[0]=0xdf;dat4[6]=0xdf;}
- if(sudu1==7){dat4[0]=0xbf;dat4[6]=0xef;}
- if(sudu1==8){dat4[0]=0x7f;dat4[6]=0xf7;}
- if(sudu1==9){dat4[0]=0xff;dat4[1]=0xfe;dat4[6]=0xfb;}
- if(sudu1==10){dat4[1]=0xfd;dat4[6]=0xfd;}
- if(sudu1==11){dat4[1]=0xfb;dat4[6]=0xfe;}
- if(sudu1==12){dat4[1]=0xf7;dat4[6]=0xff;dat4[5]=0x7f;}
- if(sudu1==13){dat4[1]=0xef;dat4[5]=0xbf;}
- if(sudu1==14){dat4[1]=0xdf;dat4[5]=0xdf;}
- if(sudu1==15){dat4[1]=0xbf;dat4[5]=0xef;}
- if(sudu1==16){dat4[1]=0x7f;dat4[5]=0xf7;}
- if(sudu1==17){dat4[1]=0xff;dat4[2]=0xfe;dat4[5]=0xfb;}
- if(sudu1==18){dat4[2]=0xfd;dat4[5]=0xfd;}
- if(sudu1==19){dat4[2]=0xfb;dat4[5]=0xfe;}
- if(sudu1==20){dat4[2]=0xf7;dat4[5]=0xff;dat4[4]=0x7f;}
- if(sudu1==21){dat4[2]=0xef;dat4[4]=0xbf;}
- if(sudu1==22){dat4[2]=0xdf;dat4[4]=0xdf;}
- if(sudu1==23){dat4[2]=0xbf;dat4[4]=0xef;}
- if(sudu1==24){dat4[2]=0x7f;dat4[4]=0xf7;}
- if(sudu1==25){dat4[2]=0xff;dat4[3]=0xfe;dat4[4]=0xfb;}
- if(sudu1==26){dat4[3]=0xfd;dat4[4]=0xfd;}
- if(sudu1==27){dat4[3]=0xfb;dat4[4]=0xfe;}
- if(sudu1==28){dat4[3]=0x77;dat4[4]=0xff;}
- if(sudu1==29){dat4[3]=0xaf;}
- if(sudu1==30){dat4[3]=0xff;sudu1=0;if(count==1){bc++;if(bc==10)count=10;}else count--;}
- }
- }
- if(xg==8)
- {
- sudu2++;
- if(sudu2==5)
- {
- sudu2=0;
- sudu1++;
- if(sudu1==1){dat4[0]=0x55;dat4[1]=0x55;dat4[2]=0x55;dat4[3]=0x55;dat4[4]=0x55;dat4[5]=0x55;dat4[6]=0x55;dat4[7]=0x55;}
- if(sudu1==2){dat4[0]=0xaa;dat4[1]=0xaa;dat4[2]=0xaa;dat4[3]=0xaa;dat4[4]=0xaa;dat4[5]=0xaa;dat4[6]=0xaa;dat4[7]=0xaa;}
- if(sudu1==3)sudu1=0;
- }
- }
- if(xg==9)
- {
- sudu2++;
- if(sudu2==10)
- {
- sudu2=0;
- sudu1++;
- if(sudu1==1){dat4[7]=0xf9;dat4[5]=0xf3;dat4[3]=0xe7;dat4[1]=0xcf;}
- if(sudu1==2){dat4[7]=0xfe;dat4[6]=0x7f;dat4[5]=0xfc;dat4[3]=0xf9;dat4[1]=0xf3;}
- if(sudu1==3){dat4[7]=0xff;dat4[6]=0x9f;dat4[5]=0xff;dat4[4]=0x3f;dat4[3]=0xfe;dat4[2]=0x7f;dat4[1]=0xfc;}
- if(sudu1==4){dat4[6]=0xe7;dat4[4]=0xcf;dat4[3]=0xff;dat4[2]=0x9f;dat4[1]=0xff;dat4[0]=0x3f;}
- if(sudu1==5){dat4[6]=0xf9;dat4[4]=0xf3;dat4[2]=0xe7;dat4[1]=0xff;dat4[0]=0xcf;}
- if(sudu1==6){dat4[6]=0xfe;dat4[5]=0x7f;dat4[4]=0xfc;dat4[2]=0xf9;dat4[0]=0xf3;}
- if(sudu1==7){dat4[6]=0xff;dat4[5]=0x9f;dat4[4]=0xff;dat4[3]=0x3f;dat4[2]=0xfe;dat4[1]=0x7f;dat4[0]=0xfc;}
- if(sudu1==8){dat4[6]=0xfe;dat4[5]=0x7f;dat4[4]=0xfc;dat4[3]=0xff;dat4[2]=0xf9;dat4[1]=0xff;dat4[0]=0xf3;}
- if(sudu1==9){dat4[6]=0xf9;dat4[5]=0xff;dat4[4]=0xf3;dat4[2]=0xe7;dat4[0]=0xcf;}
- if(sudu1==10){dat4[6]=0xe7;dat4[4]=0xcf;dat4[2]=0x9f;dat4[0]=0x3f;}
- if(sudu1==11){dat4[6]=0x9f;dat4[4]=0x3f;dat4[3]=0xfe;dat4[2]=0x7f;dat4[1]=0xfc;dat4[0]=0xff;}
- if(sudu1==12){dat4[7]=0xfe;dat4[6]=0x7f;dat4[5]=0xfc;dat4[4]=0xff;dat4[3]=0xf9;dat4[2]=0xff;dat4[1]=0xf3;}
- if(sudu1==13){dat4[7]=0xf9;dat4[6]=0xff;dat4[5]=0xf3;dat4[3]=0xe7;dat4[1]=0xcf;}
- if(sudu1==14)sudu1=0;
- }
- }
- }
复制代码
所有资料51hei提供下载:
程序.rar
(61.45 KB, 下载次数: 21)
|