demo/inpn: correct ranges in range loop
The demo is supposed to take one reading for each channel for each range, but was using the range from the command line options instead. Thanks to Daniele Mazzi for spotting the bug!
This commit is contained in:
parent
6ee63ff0b0
commit
1465834a26
1 changed files with 2 additions and 2 deletions
|
@ -64,8 +64,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
maxdata = comedi_get_maxdata(device, options.subdevice, chan);
|
||||
for(range = 0; range < n_ranges; range++){
|
||||
comedi_data_read(device, options.subdevice, chan, options.range, options.aref, &data);
|
||||
voltage = comedi_to_phys(data, comedi_get_range(device, options.subdevice, chan, options.range), maxdata);
|
||||
comedi_data_read(device, options.subdevice, chan, range, options.aref, &data);
|
||||
voltage = comedi_to_phys(data, comedi_get_range(device, options.subdevice, chan, range), maxdata);
|
||||
printf("%g ", voltage);
|
||||
}
|
||||
printf("\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue