i want to display the voltage level through a Potentiometer over the serial comm line(RS-232) in pure ASCII. I am trying to do this using MC9S08AW60 on the Board-DEMO9S08AW60E. So, if the potentiometer is at 50% position, on Hterm it should show as following:
050%
Now for this(6 bytes) i need to be able to convert decimal to ASCII and transmit the same over RS232. I cant seem to find the logic behind conversion of decimal to ASCII.
questions:
logic for conversion of decimal to ASCII?
any better ideas?
- if this question is outside the scope of this forum i am more than willing to change it to the appropriate forum.
Consider the following code:
if(TPM1SC_TOF == 1)
{
bob = ADC1RL;
dummy = (bob*100)/255;
if((SCI1S1 & (1<<7)))
{
SCI1D = dummy; // at this point i would like to send the percentage of the
//potentiometer value!
}
TPM1SC_TOF = 0;
}
Please take note of the attached block diagram!!