Shop OBEX P1 Docs P2 Docs Learn Events
Splitting a BYTE variable to an LCD (My mistake found, Thank you!!) — Parallax Forums

Splitting a BYTE variable to an LCD (My mistake found, Thank you!!)

ChrisPChrisP Posts: 136
edited 2008-08-14 17:22 in General Discussion
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

Comments

  • Sens-a-DatSens-a-Dat Posts: 44
    edited 2008-08-14 15:43
    Chris,

    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
  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-14 16:37
    I agree -- there is likely a conflict with your "temp" variables -- I'm guessing that LCD_OUT uses temp1. Can you post the whole program?
  • ChrisPChrisP Posts: 136
    edited 2008-08-14 17:22
    That was it %100, knew it was something completely simple I was missing! Thank you so much!
Sign In or Register to comment.