Skip to content

Commit

Permalink
README: Add example instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin committed Apr 25, 2024
1 parent 5fe334c commit 3c7b360
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# ping-rs
https://docs.bluerobotics.com/ping-rs/ping_rs/

## Using example:

To run examples use:

```shell
cargo run --example ping_1d -- --port-name /dev/ttyUSB0
```

Should output:
```shell
Parsing user provided values...
Creating your Pin1D device
Creating a subscription channel which will receive 30 Profile measurements, we'll check this after the next methods!
Testing set/get Device ID
Testing set command, all set commands check for their Ack message, Error and NAck error are possible
Creating two futures to read Protocol Version and Device ID
Reading the protocol version
Reading the device_id
Protocol version is: ProtocolVersionStruct { version_major: 1, version_minor: 0, version_patch: 0, reserved: 0 }
Device ID is: DeviceIdStruct { device_id: 1 }
Read the 30 packages we are waiting since the start of this example, all above tasks have success, we did it!
Received a ProfileStruct Vector with length of 30
Turning-off the continuous messages stream from Ping1D
```

0 comments on commit 3c7b360

Please sign in to comment.