WHILE 1 = 1
WHILE Keypressed = 0 'print key and exit when key pressed
Keypressed = Keypad16.Value
IF Keypressed <> 0 THEN
IF Keypressed = 16 THEN 'Keypressed = double zero
Total = Total + 50
'USART.Write ("Key pressed = 00"," Total = ", dectostr(Total), 13, 10)
WriteAt(1,1,"key pressed =",DecToStr(Keypressed,2))// double0 = 50
ELSE
Total = Total + Keypressed
'USART.Write ("Key pressed = ", decToStr(Keypressed), " Total = ", dectostr(Total), 13, 10)
WriteAt(2,1,"total=",DecToStr(Total,2))// double0 = 50
END IF
END IF
WEND
DELAYMS(100)
WHILE Keypressed <> 0 'loop until key not pressed
Keypressed = Keypad16.Value
WEND
WEND