if P3_2 0
if N q q++; while P3_2 0 ;
P3_1 1; //当P3_2按键弹起的后,P3_1口赋高电平 delay10ms 10 ;//延时子程序 P3_1 0; //返回原始界面
if P3_3 0 //当P3_3按键按下就执行病房号的显示 if q 0 q--; while P3_3 0 ; P3_1 1; delay10ms 10 ; P3_1 0; if P3_4 0 N--; if N 0
for j q;j N;j++ b[j] b[j+1]; b[N] 0;
Else
b[0] 0; while P3_4 0 ;
q 0;
P3_1 1;
delay10ms 10 ; P3_1 0;
keyboard ; if m! key m key; b[N] key; N++; P3_1 1;
delay10ms 10 ; P3_1 0;
/******************************************************/
void timer0 interrupt 1 using 1//T0中断 中
断
服
务
子
程
序
TH0 65536-50000 /256; TL0 65536-50000 %6; if d 0
display1 N,b[num],b[q] ; ys++; if ys 100 num++; d 1 ;
else if ys 105 d 0; ys 0;
if num N
num 0;//病房号数清零
/*********************************点
阵
***************************/
#include #include #include %uchar b[10];
/****************************延
时
********************************/
void delay10ms uchar d unsigned char i,j,k; for k d;k 0;k-- for i 20;i 0;i-- F or j 248;j 0;j-- ;
/******************************点
阵
显
**************************/
void display1 uchar x,uchar s,uchar p uchar i,j 0,k,m 0,n 0,w[2],y[2],z[2]; w[0] s/10; w[1] s;
y[0] x/10; y[1] x;
子
程
子
程
示
子
程
序
序
序
z[0] p/10;z[1] p; if s 0|s 16 for i 0;i 16;i++,n++
lie i;
if n 8 m 1;j 0;
for k 0;k 1;k++
hang0 shuzi2[y[m]][j];
hang1 shuzi2[y[m]][j+1]; hang2 shuzi2[z[m]][j]; hang3 shuzi2[z[m]][j+1];
hang0 0x00; //清屏
j+ 2; j 0;
hang1 0x00; hang2 0x00; hang3 0x00;
for i 16;i 64;i++
lie i;