Maker Pro
Maker Pro

Pic A/D and LCD

B

Billy

Jan 1, 1970
0
Hello all,

How does one display a value measured from an A/D on an LCD. More specific,
I have a 16F877 where I measure a value with the A/D that ranges from 0 to
h'3FF'. I want to display that value on an LCD with a range of 0 to d'5000'
(can also be 5115 for easy conversion).
I know how to measure something on the A/D and place that value in a
variable
I know how to display a string on the LCD
But what puzzles me is how to easely convert a 10 bit value to a string and
rerange it?

Any tips?

Thanks all
 
B

Billy

Jan 1, 1970
0
Billy said:
Hello all,

How does one display a value measured from an A/D on an LCD. More specific,
I have a 16F877 where I measure a value with the A/D that ranges from 0 to
h'3FF'. I want to display that value on an LCD with a range of 0 to d'5000'
(can also be 5115 for easy conversion).
I know how to measure something on the A/D and place that value in a
variable
I know how to display a string on the LCD
But what puzzles me is how to easely convert a 10 bit value to a string and
rerange it?

Any tips?

Thanks all

And i might add that I'm working in assembler
 
S

Spehro Pefhany

Jan 1, 1970
0
Hello all,

How does one display a value measured from an A/D on an LCD. More specific,
I have a 16F877 where I measure a value with the A/D that ranges from 0 to
h'3FF'. I want to display that value on an LCD with a range of 0 to d'5000'
(can also be 5115 for easy conversion).
I know how to measure something on the A/D and place that value in a
variable
I know how to display a string on the LCD
But what puzzles me is how to easely convert a 10 bit value to a string and
rerange it?

Have a look at the code examples at microchip.com and piclist.com. You
want a 16-bit binary->ASCII conversion routines or binary->BCD. In the
latter case, you'd just add '0' (the ASCII code for zero) to each
digit in turn.

Best regards,
Spehro Pefhany
 
Top