Kman,
You almost had it.
Just need to move the GOTO Main down 1 line, and clear the timer when it reaches 100 instead of after you Print it to the LCD/Terminal.
Code:
Main:
SerOut2 SO,16468,["Milage = ",DEC Miles,".", DEC Tenths ,13]
Loop:
VSSCount = TMR0 ' Get TMR0 count
IF VSSCount > 99 Then
VSSCount = 0
TMR0 = 0
Tenths = Tenths + 1
IF Tenths > 9 Then
Tenths = 0
Miles = Miles + 1
EndIF
GoTo Main
EndIF
GoTo Loop
OR, you can reduce it a little so that it works with the timer directly. Get's rid of VSSCount.
Code:
Main:
SerOut2 SO,16468,["Milage = ",DEC Miles,".", DEC Tenths ,13]
Loop:
IF TMR0 > 99 Then
TMR0 = 0
Tenths = Tenths + 1
IF Tenths > 9 Then
Tenths = 0
Miles = Miles + 1
EndIF
GoTo Main
EndIF
GoTo Loop
Now you just need a way to save it to EEPROM, so you don't lose the value when power is lost.
HTH,
Bookmarks