Skip to content

Commit 0c3875d

Browse files
authored
Update README.md
1 parent 507fa56 commit 0c3875d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Control RGB LED displays from Rust
22

3-
This repository contains rust bindings for [rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix).
3+
This repository contains rust bindings for the C++ library [rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix),
4+
which enables controlling Hub75 based displays.
45
In order to take advantage of the newer APIs, the minimum supported commit of the library is
56
[55fa32f](https://github.com/hzeller/rpi-rgb-led-matrix/commit/55fa32fc2e02afb254ac834aea93589d5b891a11)
67
(Sept. 7th, 2020), which exposes all parameters that affect how the matrix runs.
8+
9+
# Usage
10+
11+
The examples have more detailed usage, but here is basic usage to get things rendering on your display.
12+
```rust
13+
use rpi_led_matrix::{LedMatrix, LedColor};
14+
15+
let matrix = LedMatrix::new(None, None).unwrap();
16+
let mut canvas = matrix.offscreen_canvas();
17+
for red in 0..255 {
18+
for green in 0..255 {
19+
for blue in 0..255 {
20+
canvas.fill(&LedColor { red, green, blue });
21+
canvas = matrix.swap(canvas);
22+
}
23+
}
24+
}
25+
```
26+
Note that if you have wirings other than the libraries "default", you will need to construct arguments to the library to specify the layout. See `LedMatrixOptions` for more information.

0 commit comments

Comments
 (0)