BrickPi3
BrickPi3 copied to clipboard
Inital commit for Rust library. WiP
This is a driver implementation for the BrickPi3 in the Rust programming language. Still somewhat a work in progress, but the two bundled examples are tested to work.
Really cool and thanks for the PR @jhelovuo ! No one on our team has any experience with Rust; can you link a good getting started guide so we can test this out?
Hi @johnisanerd, I used https://www.rust-lang.org/en-US/ docs to study Rust.
Quick test instructions to replicate my tests:
- Use e.g. Raspbian Linux on Raspberry Pi
- Install current Rust tools from rust-lang.org by the default install instructions given there. This should give you
rustc
andcargo
commands. -
cd BrickPi3/Software/Rust/brickpi3
-
cargo build
will fetch the dependencies and build the library -
cargo build --example info
should build the "info" example, which is similar to the C++ version. Executables are produced intarget/debug/examples
by default. -
cargo build --example motors
should give a working "motors" example program. - Sensor code is completely untested. It may work by accident.
Recent improvements:
- Fixed build "script" to build successfully also on Raspbian with latest stable rustc (1.22.1)
- Tested devices: -- motors, including encoders -- EV3 IR remote -- EV3 color sensor
- added example program
sensors_ev3
to test sensors Currently I have only the hardware included in the base EV3 kit, so I need more sensors to test if they work. - rebased some commits to simplify history
No one has any experience with Rust, but we do appreciate the support. It took forever to get this in! My apologies. @jhelovuo