5 /* Converts Volts into format needed by card.
6 Input should be integer (no float) */
7 int phys_to_comedi(int val)
9 if (val >= -10 && val <= 10) {
10 return 0x2000 + (val * (0x2000/10));
17 int main(int argc, char* argv[])
25 comedi_dev = comedi_open("/dev/comedi0");
26 if (comedi_dev == NULL) {
27 comedi_perror("comedi_open");
32 status = comedi_data_write(comedi_dev, MF624_AO_SUBDEV, channel, range, aref, phys_to_comedi(5));
34 comedi_perror("comedi_data_write");