c51语言里十六进制的乘方,求:C51中把10进制转16进制数程序!

满意答案

02ae427d08e371d7e90d5b995e828d6d.png

闂垫嵎涓嶈触

2014.08.25

02ae427d08e371d7e90d5b995e828d6d.png

采纳率:54%    等级:8

已帮助:363人

#include unsigned char Get_Key;unsigned char Dis[4]={0xff,0xff,0xff,0xff}; unsigned char Seg;unsigned char Delay;unsigned int  Conut;unsigned char code disp_code[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};

void scanf(void){unsigned char recode,j;P1=~(0x01<>4;            //读取列   if(recode<0x0f)       //判断是否有键按下   {         if(++Delay>2)                Delay=3;  if(Delay==2)     //延时去抖动 16ms  { if(Conut==0) {  Dis[0]=Dis[1]=Dis[2]=Dis[3]=0xff; } Conut=1000;            for(j=0;j<4;j++){if(!(recode&0x01<

void InitTimer0(void)  //2ms{    TMOD = 0x01;    TH0 = 0xF8;    TL0 = 0x30;    EA = 1;    ET0 = 1;    TR0 = 1;}

void getdec(void){unsigned char i;unsigned int temp;  for(i=0;i<4;i++)  {     if(Dis[3]==0xff)  {     Dis[3]=Dis[2];  Dis[2]=Dis[1];  Dis[1]=Dis[0];  Dis[0]=0;  }  }  temp=Dis[3]+Dis[2]*16+Dis[1]*256+Dis[0]*4096;  Dis[0]=temp/1000;  Dis[1]=temp%1000/100;  Dis[2]=temp%100/10;  Dis[3]=temp%10;  for(i=0;i<4;i++)  {    if(Dis[i]==0)    Dis[i]=0xff;    else     break;  }}

void Timer0Interrupt(void) interrupt 1{    TH0 = 0xF8;    TL0 = 0x30; Seg=(++Seg)&0x03;   P3=0x01<

main(void){unsigned char i;InitTimer0();  while(1)  {    if(Get_Key) {    for(i=3;i>0;i--)    //显示数据移动 {   Dis[i]=Dis[i-1]; }      Dis[0]=Get_Key-1; Get_Key=0; }  }}

00分享举报

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值