Hello everyone,
I’m excited to share my latest project: BrickBeam, a Rust library that simplifies transmitting LEGO® Power Functions–style IR signals directly from your Raspberry Pi.
What BrickBeam Does
BrickBeam offers a high-level, type-safe API that abstracts away the low-level details of LEGO IR protocols. It supports multiple protocols (Extended, Single Output, Combo Direct, and Combo PWM) through modular remote controller interfaces, making it easy to build projects like LEGO train controllers or other creative IR applications.
Key Advantages
• Direct Kernel Integration: BrickBeam works directly with the Raspberry Pi kernel’s modern LIRC/rc-core interface (using overlays such as gpio-ir-tx or pwm-ir-tx) without requiring a separate lirc daemon.
• Latest Raspberry Pi OS Support: It’s fully compatible with the latest Raspberry Pi OS, ensuring a smooth and up-to-date development experience.
• Rust’s Safety & Performance: Enjoy the benefits of Rust’s memory safety and performance while interacting directly with IR hardware.
Usage Example
Here’s a quick example to get you started:
use brickbeam::{BrickBeam, Channel, Output, SingleOutputCommand, Result};
fn main() -> Result<()> {
// Initialize BrickBeam with the IR transmit device path.
let brick_beam = BrickBeam::new("/dev/lirc0")?;
// Create a Speed Remote Controller for a train motor on Channel One using the red output.
let mut motor = brick_beam.create_speed_remote_controller(Channel::One, Output::RED)?;
// Set motor speed to 5 (with negative values for reverse).
motor.send(SingleOutputCommand::PWM(5))?;
Ok(())
}
Getting Started
To add BrickBeam to your project, simply include it in your Cargo.toml:
[dependencies]
brickbeam = "0.1.0"
Ensure your Raspberry Pi is configured with a supported IR transmit overlay (gpio-ir-tx or pwm-ir-tx) so that the kernel provides the /dev/lircX device. No lirc daemon is required!
Feedback & Contributions
I’d love to hear your feedback, suggestions, or any issues you might encounter. Feel free to share your ideas or contribute on GitHub.
Thank you for checking out BrickBeam. I’m excited to see the creative projects you build with it!
Best regards,
Andrej
I’m excited to share my latest project: BrickBeam, a Rust library that simplifies transmitting LEGO® Power Functions–style IR signals directly from your Raspberry Pi.
What BrickBeam Does
BrickBeam offers a high-level, type-safe API that abstracts away the low-level details of LEGO IR protocols. It supports multiple protocols (Extended, Single Output, Combo Direct, and Combo PWM) through modular remote controller interfaces, making it easy to build projects like LEGO train controllers or other creative IR applications.
Key Advantages
• Direct Kernel Integration: BrickBeam works directly with the Raspberry Pi kernel’s modern LIRC/rc-core interface (using overlays such as gpio-ir-tx or pwm-ir-tx) without requiring a separate lirc daemon.
• Latest Raspberry Pi OS Support: It’s fully compatible with the latest Raspberry Pi OS, ensuring a smooth and up-to-date development experience.
• Rust’s Safety & Performance: Enjoy the benefits of Rust’s memory safety and performance while interacting directly with IR hardware.
Usage Example
Here’s a quick example to get you started:
use brickbeam::{BrickBeam, Channel, Output, SingleOutputCommand, Result};
fn main() -> Result<()> {
// Initialize BrickBeam with the IR transmit device path.
let brick_beam = BrickBeam::new("/dev/lirc0")?;
// Create a Speed Remote Controller for a train motor on Channel One using the red output.
let mut motor = brick_beam.create_speed_remote_controller(Channel::One, Output::RED)?;
// Set motor speed to 5 (with negative values for reverse).
motor.send(SingleOutputCommand::PWM(5))?;
Ok(())
}
Getting Started
To add BrickBeam to your project, simply include it in your Cargo.toml:
[dependencies]
brickbeam = "0.1.0"
Ensure your Raspberry Pi is configured with a supported IR transmit overlay (gpio-ir-tx or pwm-ir-tx) so that the kernel provides the /dev/lircX device. No lirc daemon is required!
Feedback & Contributions
I’d love to hear your feedback, suggestions, or any issues you might encounter. Feel free to share your ideas or contribute on GitHub.
Thank you for checking out BrickBeam. I’m excited to see the creative projects you build with it!
Best regards,
Andrej
Statistics: Posted by azachar — Sun Apr 06, 2025 8:43 pm