Re: LCD Display Formatting
Hi,
That depends on HOW you scale the values and what's actually stored in B0, B1 and B2. As written the LCDOUT statement will send whatever is stored in B0 to the LCD meaning that if the B0 holds the value 65 you'll get the letter 'A' on the screen because the ASCII code for 'A' is 65. So, if you have ALREADY converted the value to ASCII and stored the first digit in B0 and the second in B1 then what you have is correct.
What I suspect you want is something like
Code:
Voltage VAR WORD
Voltage = ADResult */ 125 'Convert 0-1023 to 0-500 (roughly)
LCDOUT $FE, $80, DEC Voltage / 100, "." DEC Voltage // 100
/Henrik.
Re: LCD Display Formatting
Yes your formatting looks good.
Re: LCD Display Formatting
Hi Henrick,
Yep, goes without saying that (a) the data stored would be in ASCII format and (b) I don't do stupid things like using B0,B1, etc instead of labels :-(. Geez, I am getting old................ As well as getting old, I'm getting lazy. Thank God for much early programming experience because the PBP manual ain't exactly forth coming :-)
Thanks for coming back
best regards
Jim
Quote:
Originally Posted by
HenrikOlsson
Hi,
That depends on HOW you scale the values and what's actually stored in B0, B1 and B2. As written the LCDOUT statement will send whatever is stored in B0 to the LCD meaning that if the B0 holds the value 65 you'll get the letter 'A' on the screen because the ASCII code for 'A' is 65. So, if you have ALREADY converted the value to ASCII and stored the first digit in B0 and the second in B1 then what you have is correct.
What
I suspect you want is something like
Code:
Voltage VAR WORD
Voltage = ADResult */ 125 'Convert 0-1023 to 0-500 (roughly)
LCDOUT $FE, $80, DEC Voltage / 100, "." DEC Voltage // 100
/Henrik.
Re: LCD Display Formatting
Have you set up the circuit and tested any of your code?
If not then that is what I would do...
noting like the instant feedback of seeing the minor changes to your code and the effect on what is displayed on the LCD.