This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ascii to float conversion

dear friends

i would like to know how can we convert the ascii values to decimal values to perform some calculations.
my requirement is that i am receiving a six digit ascii data via com port of AT 89c52.now i have to perform some calculations with this value and send back via comport.so first i have tonvert the receiving ASCII value to a float value, then after the necessary calculations i've to convert the result again to ASCII to send via com port.can anyone provide some idea ?

sunish

Parents
  • hai
    thank you for the reply
    i will explain the requirement
    i am receiving six charectors via USART from the computer.we know that will be in ascii format.i stored the charectors in an array.i want to devide the value with a number which will be read from the key board.then i want to send back the result to the computer.to do this first i've to convert the ascii values to a float value because after division the result can be a float value.now to send back the result,we should again convert the value to the ascii format.in keil,there are functions called toascii and to int but i cannot apply this for any float value.is there any way that i can solve this problem?

    thank you

    sunish nair

Reply
  • hai
    thank you for the reply
    i will explain the requirement
    i am receiving six charectors via USART from the computer.we know that will be in ascii format.i stored the charectors in an array.i want to devide the value with a number which will be read from the key board.then i want to send back the result to the computer.to do this first i've to convert the ascii values to a float value because after division the result can be a float value.now to send back the result,we should again convert the value to the ascii format.in keil,there are functions called toascii and to int but i cannot apply this for any float value.is there any way that i can solve this problem?

    thank you

    sunish nair

Children