Splitting a BYTE variable to an LCD (My mistake found, Thank you!!)
I'm at a total loss, for some reason this chunk of code always returns the second digit on the LCD as 0. I'm sure its something obvious but it eludes me.
Time(1) = 184
LCD_OUT LCDCR
LCD_STR "Second"
LCD_OUT LCDRt
LCD_STR "Lane:"
Place(1) = Place(1) + 48
LCD_OUT Place(1)
LCD_OUT LCDRt
temp1 = Time(1) / 100
temp2 = __remainder / 10
temp3 = __remainder
temp1 = temp1 + 48
LCD_OUT temp1
temp2 = temp2 + 48
LCD_OUT temp2
temp3 = temp3 + 48
LCD_OUT temp3
This will display the BYTE variable "Time(1) as 104 instead of 184. What am·I doing wrong?
Post Edited (ChrisP) : 8/14/2008 5:25:09 PM GMT
Time(1) = 184
LCD_OUT LCDCR
LCD_STR "Second"
LCD_OUT LCDRt
LCD_STR "Lane:"
Place(1) = Place(1) + 48
LCD_OUT Place(1)
LCD_OUT LCDRt
temp1 = Time(1) / 100
temp2 = __remainder / 10
temp3 = __remainder
temp1 = temp1 + 48
LCD_OUT temp1
temp2 = temp2 + 48
LCD_OUT temp2
temp3 = temp3 + 48
LCD_OUT temp3
This will display the BYTE variable "Time(1) as 104 instead of 184. What am·I doing wrong?
Post Edited (ChrisP) : 8/14/2008 5:25:09 PM GMT
Comments
My first glance through the code does not seem to show me any errors. But I do wonder if you are using temp2 in the LCD_OUT routine. If so, it likely is being reassigned to a different value
Gary