[−][src]Struct rpi_led_matrix::LedMatrix
The Rust handle for the RGB matrix.
use rpi_led_matrix::{LedMatrix, LedColor}; let matrix = LedMatrix::new(None, None).unwrap();
Implementations
impl LedMatrix
[src]
pub fn new(
options: Option<LedMatrixOptions>,
rt_options: Option<LedRuntimeOptions>
) -> Result<LedMatrix, &'static str>
[src]
options: Option<LedMatrixOptions>,
rt_options: Option<LedRuntimeOptions>
) -> Result<LedMatrix, &'static str>
Creates the rust handle for the RGB matrix, given the optional options.
use rpi_led_matrix::{LedMatrix, LedColor, LedMatrixOptions}; let mut options = LedMatrixOptions::new(); options.set_hardware_mapping("adafruit-hat-pwm"); let matrix = LedMatrix::new(Some(options), None).unwrap();
pub fn canvas(&self) -> LedCanvas
[src]
Retrieves the on screen canvas.
pub fn offscreen_canvas(&self) -> LedCanvas
[src]
Retrieves the offscreen canvas. Used in conjunction with swap.
pub fn swap(&self, canvas: LedCanvas) -> LedCanvas
[src]
Cleanly swaps the canvas on v-sync, returning the off-screen canvas for updating.
use rpi_led_matrix::{LedMatrix, LedColor}; let matrix = LedMatrix::new(None, None).unwrap(); let mut canvas = matrix.offscreen_canvas(); let mut color = LedColor { red: 0, green: 0, blue: 0 }; while(color.red < 255) { canvas.fill(&color); canvas = matrix.swap(canvas); color.red += 1; }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LedMatrix
impl !Send for LedMatrix
impl !Sync for LedMatrix
impl Unpin for LedMatrix
impl UnwindSafe for LedMatrix
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,