1 /* Humusoft data acquisition library.
\r
2 * Example that shows reading of digital input channels using
\r
3 * the function to read separate bits from a single channel.
\r
6 /* Copyright 2002-2007 Humusoft s.r.o. */
\r
10 #include "hudaqlib.h"
\r
13 int main(int argc, char* argv[])
\r
19 /* open a handle to the first MF624 device in the system */
\r
20 h = HudaqOpenDevice("MF624", 1, 0);
\r
23 printf("\nData acquisition device not found.\n");
\r
27 /* read all 8 bits from digital inputs in a loop, print their values */
\r
30 value = HudaqDIReadBit(h,0,i); /* Read one bit from digital input */
\r
31 printf("bit:%d, %d ", i, value);
\r
35 /* close the device handle */
\r
36 HudaqCloseDevice(h);
\r