| Crates.io | hermes-five-macros |
| lib.rs | hermes-five-macros |
| version | 0.1.0 |
| created_at | 2025-02-10 08:22:32.23616+00 |
| updated_at | 2025-02-10 08:22:32.23616+00 |
| description | Macros definitions for hermes-five. |
| homepage | |
| repository | https://github.com/dclause/hermes-five |
| max_upload_size | |
| id | 1549771 |
| size | 19,377 |
Hermes-Five is an open-source, Firmata Protocol-based, IoT and Robotics programming framework - written in Rust.
The ultimate goal of this project is to mimic the functionalities of Johnny-Five framework where it finds its inspiration (hence the name) - but using Rust. That being said, the project is done in my spare time and does not intend to compete with any other solutions you might want to try,
Documentation is available to you in three forms:
In a nutshell:
cargo new my_awesome_project
cd my_awesome_project
Cargo.toml file.[dependencies]
hermes-five = "0.1.0"
src/main.rs file as need (
see examples)[!TIP] Available feature flags are:
- libudev -- (enabled by default) Activates
serialportcrate libudev feature under-the-hood (required on Linux only for port listing).- serde -- Enables serialize/deserialize capabilities for most entities.
- mock -- Provides mocked entities of all kinds (useful for tests mostly).
Hermes-Five is a Rust library designed to "remotely" control Arduino (or compatible) boards as well as all types of
input/output devices (led, servo, button, sensors, etc.) connected to it.
It can be compared to Johnny-Five in the javascript ecosystem.
Hermes-Five is a Rust library designed to "remotely" control Arduino (or compatible boards) using Rust code.
Board (Arduino currently)IoProtocol connection (Serial for the moment)Device such as Output (LED, servo, etc.) or Input (button, switch, sensors,Animation with auto-interpolate movementsIf you wish to do the same with absolutely no code via a nice-and-shiny interface, please consult the Hermes-Studio project.
The following code demonstrates the simplest program we could imagine: blink the Arduino embedded led on pin 13.
use hermes_five::hardware::{Board, BoardEvent};
use hermes_five::devices::Led;
#[hermes_five::runtime]
async fn main() {
// Register a new board.
// (of type arduino + auto-detected serial port by default)
let board = Board::run();
// When board communication is ready:
board.on(BoardEvent::OnReady, |board: Board| async move {
// Register a LED on pin 13 (arduino embedded led).
// Pin: 13; OFF by default
let mut led = Led::new(&board, 13, false)?;
// Blinks the LED every 500ms: indefinitely.
led.blink(500);
Ok(())
});
}
All available examples can be found in the examples folder.
To start an example, run the following command:
cargo run --example folder_examplename
To run an example in a file called examples/folder/examplename.rs, use the concatenation name
as folder_examplename.
If you want the "full" log output you can use:
RUST_LOG=DEBUG cargo run --example folder_examplename
For details, see the full roadmap: currently working toward release 0.1
In short:
All contributions are more than welcome through PR and the issue queue.
git checkout -b feature-branchgit commit -am 'Add new feature'git push origin feature-branchThe author does not claim to know everything about Rust programming or IoT, and all ideas are welcome as long as they respect the project's original philosophy.
This project is licensed under the MIT License. See the LICENSE file for details.
For support, please open an issue or reach out to the author.