Create a new Application

-File

examples/simple.c

The simple example is a simple "DO" example. It will show you how to develop an application with the device using this driver.

-Complete Source code of the application

/* include the header file */
#include <advdevice.h>
#include <advdaq.h>
int main()
{
PTR_T fd;
INT32S ret;

INT32U port_start = 0;
INT32U port_count = 1;
INT8U  buffer;

ret = DRV_DeviceOpen("/dev/advdaq0", &fd); //open the device, get the 
if (ret)
{
	return -1;
}


ret = DRV_DioWriteDOPorts(fd, port_start, port_count, &buffer); //DO operation
if (ret)
{

}

DRV_DeviceClose(&fd); //close the device

return 0;
}