hashim5003
Junior Member level 2
- Joined
- Jul 21, 2013
- Messages
- 21
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 3
- Activity points
- 116
Hi, I am using ADC0804 and converting binary value to decimal as follows:
and display it on LCD like:
My question is that how I can convert adc value to single integer?
I want to combine a,b,c into single integer.
Code:
void binary_to_decimal()
{
value = OUTPUT; //get value from ADC
x = value / 10; //binary to decimal conversion
a = x / 10; //MSB of digital value
b = x % 10; //middle digit
c = value % 10; //LSB
}
and display it on LCD like:
Code:
lcddata (a + 0x30); //display digital value on LCD
lcddata (b + 0x30);
lcddata (c + 0x30);
My question is that how I can convert adc value to single integer?
I want to combine a,b,c into single integer.