How to Set Up Code::Blocks IDE to run Linux Examples

The following are suggestions to install and configure Code::Blocks to easily load and run the Linux and/or DaqHat examples.

First and as always update your package list: sudo apt-get update

depending on whether you will be using the Raspberry PI DaqHats or the UL for Linux for our USB devices, follow the instructions on the following pages to install the hardware support

www.github.com/mccdaq/daqhats (RPI DaqHat support) or www.github.com/mccdaq/uldaq (MCC USB device support)

Now install Code::Blocks sudo apt-get install codeblocks

Raspberry PI Launch Code::Blocks by clicking the raspberry icon–>Programming–>Code::Blocks IDE

Linux (Ubuntu) Launch Code::Blocks by clicking the Apps icon and choosing Code::Blocks

Modify Code::Blocks Link Libraries to add the paths shown below. If you are on a Raspberry PI you may have both paths defined. If on a Ubuntu PC, you will have only /usr/local/libuldaq.so

Modify the compiler search directories adding the following: /usr/local/include/daqhats /home/pi/libuldaq-1.1.1/examples if you have the MCC 172 add /home/pi/kissfft for the FFT module

CodeBlocksContinousScanningCodeBlocksContinousScanning

close the dialog with OK

Next load an example. Choose File–>Open and browsing to /daqhats/examples/c/mcc118/continuous_scan/continuous_scan.c or the example you wish to run. Choose the menu item Build–>Build and run. This should launch a terminal with instructions

To run the Logger program, first visit the following page: https://github.com/mccdaq/daqhats/tree/master/examples/c/mcc118/data_logger

Click the Readme.md file to view the installation instructions for following dependencies GTK+ cross-platform toolkit for creating graphical user interfaces. GtkDatabox widget used to display two-dimensional data. D-Bus AT-SPI protocol. Note, the Readme.md is displayed correctly when viewing on github. It recommended not to view this file with a text editor because there are formatting commands that can be misconstrued as installation commands.

After installing the dependencies, browse to the MCC118 Logger folder and open the project file named logger.cbp. Start the program using the menu item Build–>Build and run.