Skip to content
Snippets Groups Projects
Commit 712321bb authored by Samuel Tardieu's avatar Samuel Tardieu
Browse files

Indicate how to check for firmware version in Rust README example

parent f5234992
No related branches found
No related tags found
1 merge request!44Indicate how to check for firmware version in Rust README example
Pipeline #99086 passed
...@@ -112,6 +112,9 @@ use tele0592::controller::{Controller, Device}; ...@@ -112,6 +112,9 @@ use tele0592::controller::{Controller, Device};
fn main() -> anyhow::Result<()> { fn main() -> anyhow::Result<()> {
// Initialize the motor driver // Initialize the motor driver
let mut controller = I2c::with_bus(8)?; let mut controller = I2c::with_bus(8)?;
// Check that the controller runs a firmware compatible with this API
controller.check_firmware_version()?;
// Set the auto shutdown timeout to 4 seconds // Set the auto shutdown timeout to 4 seconds
controller.set_motor_shutdown_timeout(Duration::from_secs(4.0))?; controller.set_motor_shutdown_timeout(Duration::from_secs(4.0))?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment