vailant
Newbie level 5
Hi all..
currently im using C8051F226 using silab in C language.. and my display is using a display module uOLED-96-G1..
i've set up the ADC and it work fine.. and now when i input a voltage of 0 to 3v, i'll get the int ADCvalue as 0 to 255... and im able to display the number on the uOLED. ADCvalue = ADC0H..
What i want to do now is to convert the ADC value back to the analog value...e.g.
if my int ADCvalue is 255.. i want to get 3.0
if my int ADCvalue is 127 or 128.. i want to get 1.5
if my int ADVvalue is 0.. i want to get 0.0... etc..
i've already printed the decimal point('.') on my display.. so now i need to get 2 seperate interger
when my ADCvalue is 255... i want '3' & '0'
when my ADCvalue is 127 or 128... i want '1' & '5' etc...
the problem is that my display wont be able to do printf function.. meaning i cant use the %f, %d, etc...
can any1 please help me with some calculation coding?? does it got to do with the bits resolution?
currently im using C8051F226 using silab in C language.. and my display is using a display module uOLED-96-G1..
i've set up the ADC and it work fine.. and now when i input a voltage of 0 to 3v, i'll get the int ADCvalue as 0 to 255... and im able to display the number on the uOLED. ADCvalue = ADC0H..
What i want to do now is to convert the ADC value back to the analog value...e.g.
if my int ADCvalue is 255.. i want to get 3.0
if my int ADCvalue is 127 or 128.. i want to get 1.5
if my int ADVvalue is 0.. i want to get 0.0... etc..
i've already printed the decimal point('.') on my display.. so now i need to get 2 seperate interger
when my ADCvalue is 255... i want '3' & '0'
when my ADCvalue is 127 or 128... i want '1' & '5' etc...
the problem is that my display wont be able to do printf function.. meaning i cant use the %f, %d, etc...
can any1 please help me with some calculation coding?? does it got to do with the bits resolution?