Forum Discussion
Altera_Forum
Honored Contributor
16 years agoGet integer value from character array
I have character arrays of 3 ascii characters representing range values from a sonar. I need to do some calculation on these values now. How can I convert the ascii char array to a valid integer ...
Altera_Forum
Honored Contributor
16 years agoIn C, you can just use the stdlib.h function ATOI. to convert ascii to integer. In HDL, you take each value, subtract 30, then mutiply by the correct power of ten multiplier to based on the bit location, then sum them all up,
Pete