|
在老师要求下,弄了一个基于51的体重秤。还得自己加功能上去,表示很无奈啊,截图是我现在的一些情况。
程序老是死在这里,按键根本没用,有大神知道的吗
附上main程序
#include <reg51.h>
#include <intrins.h>
#include "global.h"
#include "lcd.h"
#include "key.h"
extern keypress();
/*
INT0 Init
*/
void InitINT0()
{
EA = 1;
IT0 = 1;
EX0 = 1;
}
/*
T0 Init ¶¨ê±50ms
*/
void InitT0()
{
EA = 1;
TMOD = 0x01;
TH0 = (65535 - 50000)/256;
TL0 = (65535 - 50000)%256;
ET0 = 1;
}
/*
T0 interruption function
*/
void TimeUp() interrupt 1
{
InitINT0();
PCON |= 0x02;
}
/*
INT0 interruption function
*/
void INT0Start() interrupt 0
{
KeyPress();
}
int main(void)
{
//InitINT0();
//InitT0();
InitLcd1602();
//TR0 = 1;
while(1)
{
KeyPress();
}
}
|
评分
-
查看全部评分
|