1 unstable release
Uses new Rust 2024
| 0.1.0 | Jul 30, 2025 |
|---|
#2140 in Hardware support
46KB
492 lines
A rust driver for the DigOutBox
This driver provides all functionalities of the DigOutBox. Connecting the DigOutBox via USB cable to your computer creates a serial port interface that you can use to communicate with the box.
Example
use instrumentrs::SerialInterface;
use digoutbox::DigOutBox;
let port = "/dev/ttyACM0";
let baud = 9600;
// Create a new serial instrument interface and use it to create a new DigOutBox instance.
let inst_interface = SerialInterface::simple(port, baud).unwrap();
let mut inst = DigOutBox::new(inst_interface);
// Get the first channel (index 0) and set it to high.
let mut channel = inst.get_channel(0).unwrap();
channel.set_output(true).unwrap();
// Now turn all channels off.
inst.all_off().unwrap();
Rust controller class for the DigOutBox
This is the rust controller package for the DigOutBox project.
To run the examples, you can use the following command:
cargo run --example $NAME
Here, $NAME should be replaced with the name of the example you want to run.
Dependencies
~2–12MB
~107K SLoC