[求助]请高手帮忙修改程序
题目如下:用ATMEL89c51单片机制作一个转速测量系统,用c语言编写源程序,测量周期,角频率,转速,任选一个。并且用Protel画出印制版电路图。
园盘上面有小孔,可以根据小孔来测量转速,角频率,或者周期,等等。
以下是同学写的程序,小弟单片机知识匮乏,又崔得比较急,请高手帮忙修改,跟同学的有所区别,能应付交差就行。不胜感激!(希望在关键步骤后稍加注释,谢谢了)
# include < reg52.h>
typedef unsigned char byte
byte count.low
byte count.high
int count_value
void clock0_initial ( ) reentrant using 0
{ TCON=0X00;
TH0=0X00;
TL0=0X00;
TR0=1;
}
void count_module (byte a )
{do
{ count_high=TH0;RESETCS=1;
} while (count_high!=TH0);
}
Void main ()
{ TMOD=0x05;
clock0_initial ( );
ET0=1;
EA=1;
do { count_module (1); } P1=CNT=> 8;P2=CNT;
while (1); }
void clk_int(void) interrupt 1 using 0
{ count_value=count_value+1;
clock1_initial (1);
}
发表时间:2004年8月28日10:54:25