convert c code from TI CCS to c

Status
Not open for further replies.

lgeorge123

Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
Visit site
Activity points
1,403
I have a c code from TI CCS as follows:
float Ic;
lc=(float) (AIC23_data.channel
);

it convert LEFT channel of ADC to float number , how can I do this in like Convert function ( C format )other than TI CCS such as

float Ic;
byte Adcvalue = { 1,1,1,0,0,1,1,0}; // from 8 bit ADC value
float Convert(byte value);
Ic (float) = Convert(Adcvalue);​
 

Hello!

Just to make things clear, there is no TI CCS C and other C, there is C, period.

Now converting to float is done by a plain cast, but apparently you know that.
Cast is pretty standard and should work with any compiler.
Now one thing: why do you want to use float numbers? Usually it's a lot slower
to calculate with floats than with integers, then another issue is that converting
to float a value that has a very limited set of possible values (4096 if you use
TI processors) is a bit surprising.

Dora.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…