/* * demo for changing between different (hardware-based) calibrations * Part of Comedilib * * Copyright (c) 1999,2000 David A. Schleef * * This file may be freely modified, distributed, and combined with * other software, as long as proper attribution is given in the * source code. */ /* * A little output demo */ #include #include #include #include #include #include #include #include #include "examples.h" comedi_t *device; int main(int argc, char *argv[]) { lsampl_t data; int ret; struct parsed_options options; init_parsed_options(&options); parse_options(&options, argc, argv); device=comedi_open(options.filename); if(!device){ comedi_perror(options.filename); exit(-1); } data = options.value; if(options.verbose){ printf("writing %d to device=%s subdevice=%d channel=%d range=%d analog reference=%d\n", data, options.filename, options.subdevice, options.channel, options.range, options.aref); } ret = comedi_apply_calibration(device, options.subdevice, options.channel, options.range, options.aref, NULL); if(ret < 0){ comedi_perror(options.filename); exit(0); } return 0; }