优快云的BLOG是玩什么呢???天天donw啊!!!

优快云的BLOG是玩什么呢???天天donw啊!!!
#include "Seg.h" unsigned char seg_dula[] = { 0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, // 0-7 0x80, 0x90,0xff}; // 位码表 (选择第几位数码管) unsigned char seg_wela[] = { 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 }; void Seg_Disp(unsigned char wela,dula,point){ P0=0xff; P2=P2&0x1f|0xe0; P2&=0x1f; P0=seg_wela[wela]; P2=P2&0x1f|0xc0; P2&=0x1f; if(point) P0=seg_dula[dula]&0x7f; else P0=seg_dula[dula]; P2=P2&0x1f|0xe0; P2&=0x1f; } /* 头文件声明区域 */ #include <Key.h> #include <Init.h> #include <Led.h> #include <Seg.h> #include <STC15F2K60S2.H> /* 变量声明区*/ unsigned char Key_Slow_Donw; unsigned char Seg_Slow_Donw; unsigned char Key_Val,Key_Donw,Key_Up,Key_Old; unsigned char Seg_Buf[8]={1,2,3,4,5,6,7,8}; unsigned char Seg_Pos; unsigned char Seg_Point[8]={0,0,0,0,0,0,0,0}; /*按键处理函数*/ void Key_Proc() { if(Key_Slow_Donw) return; Key_Slow_Donw=1; Key_Val=Key_Read(); Key_Donw=Key_Val&(Key_Old^Key_Val); // 检测按下 Key_Up=~Key_Val&(Key_Old^Key_Val); // 检测抬起 Key_Old=Key_Val; } void Seg_Proc(){ if(Seg_Slow_Donw) return; Seg_Slow_Donw=1; } /* 其他显示函数 */ void Led_Proc() { } void Timer0Init(void) //1毫秒@12.000MHz { AUXR |= 0x70; //定时器时钟1T模式 TMOD &= 0xF0; //设置定时器模式 TL0 = 0x18; //设置定时初值 TH0 = 0xFC; //设置定时初值 TF0 = 0; //清除TF0标志 TR0 = 1; //定时器0开始计时 ET0=1; EA=1; } void Timer0Server() interrupt 1 { if(++Key_Slow_Donw==10) Key_Slow_Donw=0; if(++Seg_Slow_Donw==10) Seg_Slow_Donw=0; if(++Seg_Pos==8) Seg_Pos=0; Seg_Disp(Seg_Pos,Seg_Buf[Seg_Pos],Seg_Point[Seg_Pos]); } void main(void) { sys_init(); Timer0Init(); while(1) { Led_Proc(); Key_Proc(); Seg_Proc(); } return ; } 我的代码如上 但是出现了下面这些问题/* 头文件声明区域 */ #include <Key.h> #include <Init.h> #include <Led.h> #include <Seg.h> #include <STC15F2K60S2.H> /* 变量声明区*/ unsigned char Key_Slow_Donw; unsigned char Seg_Slow_Donw; unsigned char Key_Val,Key_Donw,Key_Up,Key_Old; unsigned char Seg_Buf[8]={1,2,3,4,5,6,7,8}; unsigned char Seg_Pos; unsigned char Seg_Point[8]={0,0,0,0,0,0,0,0}; /*按键处理函数*/ void Key_Proc() { if(Key_Slow_Donw) return; Key_Slow_Donw=1; Key_Val=Key_Read(); Key_Donw=Key_Val&(Key_Old^Key_Val); // 检测按下 Key_Up=~Key_Val&(Key_Old^Key_Val); // 检测抬起 Key_Old=Key_Val; } void Seg_Proc(){ if(Seg_Slow_Donw) return; Seg_Slow_Donw=1; } /* 其他显示函数 */ void Led_Proc() { } void Timer0Init(void) //1毫秒@12.000MHz { AUXR |= 0x70; //定时器时钟1T模式 TMOD &= 0xF0; //设置定时器模式 TL0 = 0x18; //设置定时初值 TH0 = 0xFC; //设置定时初值 TF0 = 0; //清除TF0标志 TR0 = 1; //定时器0开始计时 ET0=1; EA=1; } void Timer0Server() interrupt 1 { if(++Key_Slow_Donw==10) Key_Slow_Donw=0; if(++Seg_Slow_Donw==10) Seg_Slow_Donw=0; if(++Seg_Pos==8) Seg_Pos=0; Seg_Disp(Seg_Pos,Seg_Buf[Seg_Pos],Seg_Point[Seg_Pos]); } void main(void) { sys_init(); Timer0Init(); while(1) { Led_Proc(); Key_Proc(); Seg_Proc(); } return ; } 我应该如何修改
11-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值