Skip to content

Latest commit

 

History

History

cpp-usbdux

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

C++-USBDUX

A header-only C++ library which provides a C++ callback interface for the async analogue data acquisition of the USB-DUX sigma.

How to use

  1. Define a callback which is called at the samplingrate
struct DUXCallback : CppUSBDUX::Callback {
	virtual void hasSample(const std::vector<float> &data) {
		/// Do something with "data" here!
	}
};

DUXCallback cb;
  1. Create an instance of CppUSBDUX for example as an instance varibale in your application class.
CppUSBDUX usbdux;
  1. Open the USB-DUX device
usbdux.open();
  1. Start the data-acquistion
usbdux.start(&cb,8,250);

where the callback cb is called at a rate of 250Hz and it delivers 8 channels.

  1. Stop the data-acquisition
usbdux.stop();

How to compile the demo

To run the demo just type

cmake .
make

and then run

./print2screen_demo

which prints the values of the 1st 8 channels in Volt on the screen. You can pipe them into a text-file and plot them:

./print2screen_demo > /tmp/data.txt
gnuplot> plot "/tmp/data.txt" using 1 w l

alt tag