Test and Measurement Forum

max_adc_value ??

Post your C and C++ discussions here

max_adc_value ??

Postby tohk » Fri Aug 03, 2012 12:32 pm

Hi all
I'm very sorry poor strange ENGLISH.

In USB DrDAQ sample source [USBDrDAQcon.c]
[max_adc_value] is defined but It seems ZERO.
So error [Division by ZERO] in adc_to_mv().

How much to set [max_adc_value]?



>unsigned short max_adc_value;

>int adc_to_mv (int raw){
> int scaled;
> if (scale_to_mv){
> scaled = raw * 2500 / max_adc_value;
> }
> else{
> scaled = raw;
> }
> return scaled;
>}
tohk
Newbie
 
Posts: 0
Joined: Fri Aug 03, 2012 12:16 pm

Re: max_adc_value ??

Postby Martyn » Mon Aug 06, 2012 11:10 am

Max ADC value should be 32767
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2291
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests