|
在老師要求下,弄了一個(gè)基于51的體重秤。還得自己加功能上去,表示很無奈啊,截圖是我現(xiàn)在的一些情況。
程序老是死在這里,按鍵根本沒用,有大神知道的嗎
附上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();
}
}
|
評(píng)分
-
查看全部評(píng)分
|