'----------------------------------------------------------------------------------------------------- $crystal = 12000000 $baud = 4800 Dim Count As Byte Wait 1 Print "An example of a program that counts up and down at the push of an appropriate button" Count = 0 Do ' now it will check the three keys If P3.3 = 0 Then 'TP1 key was pushed Waitms 250 Incr Count 'increase for 1 Print "Value of the Count variable = "; Count Elseif P3.2 = 0 Then 'TP2 key was pushed Waitms 250 Decr Count 'decreases value for 1 Print "Value of the Count variable = " ; Count Elseif P3.0 = 0 Then 'TP3 key was pushed Waitms 250 Count = 0 'reset value to 0 Print "Value of the Count variable = " ; Count End If Loop '-----------------------------------------------------------------------------------------------------