Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cobular/lkmtechcandriver-rust
https://github.com/cobular/lkmtechcandriver-rust
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cobular/lkmtechcandriver-rust
- Owner: Cobular
- Created: 2024-01-28T08:08:14.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-19T18:46:30.000Z (11 months ago)
- Last Synced: 2024-05-02T06:18:01.850Z (8 months ago)
- Language: Rust
- Size: 2.43 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LKM Tech Motor Driver
This project is a basic program that takes speed goals from stdin and sends them to the motor. It's written in Rust and uses the `lkmtech_motor_driver` library to control the motor.
## Prerequisites
- Rust programming language
- `lkmtech_motor_driver` library## Usage
To use this program, you need to run the `basic_speed_setting.rs` file. This file reads speed goals from the standard input (stdin) and sends them to the motor.
```bash
cargo run --example basic_speed_setting
```Then, you can input your speed goals line by line. The program will send these speed goals to the motor using closed-loop control.
## Code Overview
The `basic_speed_setting.rs` file contains the main function of the program. It creates a new `MgMotor` instance, which represents the motor. The motor is connected to the "vcan0" virtual CAN interface, and it uses the CAN ID 0x1 and a timeout of 10 milliseconds.
The program then reads lines from stdin in a loop. Each line is parsed as an integer, which represents the speed goal. The speed goal is then sent to the motor using the `send_speed_closed_loop_control` method of the `MgMotor` instance.
## Contributing
Contributions are welcome! Please feel free to submit a pull request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.