Page 763 - 2
P. 763
if(default_height >= distance)
{
distance = default_height - distance;
d_1 = distance %100 /10;
d_10 = distance%10;
distance = distance/100;
height[0] = d_10;
height[1] = d_1;
height[2] = distance % 10;
height[3] = distance/10 % 10;
height[4] = distance /100;
lcd_clear();
lcd_gotoxy(0,0);
sprintf(sbuf,"Height = %d.%d%d",distance,d_1,d_10);
lcd_puts(sbuf);
}
else
{
lcd_clear();
lcd_gotoxy(0,0);
lcd_puts("Error: Range");
}
}
}
void GetWeight(void) // 키 매트릭스를 이용해 키를 입력받는 함수
{
if(height[0]*100+height[1]*10 <= 50)
{
lcd_clear();
lcd_gotoxy(0,0);
lcd_puts("# Measure #");
lcd_gotoxy(0,1);
lcd_puts("# Height First #");
mode = -1;
return;
}
for(i=0; i<5; i++)
- 763 -