Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Mon Jul 01, 2013 2:51 pm |
|
|
What you are doing has no resemblance to what I suggested....
| Code: |
signed int16 val;
//for a single channel
val=read_adc();
val-=337;
val*=6;
if (val<0)
printf("-%4.2w",-val);
else
printf("%4.2w",val);
|
However it only has a hope of working, if your original maths is actually right. I'd suspect you just have the conversion formula wrong, hence the wrong values....
Best Wishes |
|