This project contains a template to get you started writing a custom C program using the Joulescope driver.
The general process is:
- Install local build tools.
- Fork this project on GitHub and clone locally.
- Build the example.
- Run the example. It should display statistics from a connected JS220.
- Modify CMakeLists.txt with your project name (executable name) and version.
- Modify src/main.c to become your desired program.
- [optional] Push to a new GitHub repo or private repo.
The recommended tools are:
Windows: download the binaries for git and cmake using the links above. Install them. Then install Visual Studio 2022 Community. Select the "Desctop development with C++" workload which includes the latest MSVC and Windows SDK.
macOS: we recommend homebrew](https://brew.sh/). Follow the installation instructions,
and then brew install git cmake
Ubuntu: sudo apt install git cmake build-essential
At a command line, type:
cd <YOUR_BASE_PATH>
git clone https://github.com/jetperch/joulescope_driver_c_template.git <YOUR_PROJECT_NAME>
cd <YOUR_PROJECT_NAME>
git submodule init
git submodule update
You should also edit the project name and version in CMakeLists.txt.
Use cmake to configure the build system:
cd <YOUR_BASE_PATH>/<YOUR_PROJECT_NAME>
mkdir build
cd build
cmake ..
From then on, from the project directory, build using:
cmake --build build
You can then run the executable:
Windows: .\build\src\Debug<project_name>
macOS and Ubuntu: ./build/src/Debug/<project_name>