pub struct LedRing<const N: usize = 12> {
pub animation: RingAnimation,
/* private fields */
}Expand description
Stateful LED ring that tracks animation and renders frames.
N is the number of LEDs in the ring.
clock_map maps logical positions (clock hours) to physical LED indices.
Fields§
§animation: RingAnimationImplementations§
Source§impl<const N: usize> LedRing<N>
impl<const N: usize> LedRing<N>
Sourcepub fn new(clock_map: &[usize; N]) -> LedRing<N>
pub fn new(clock_map: &[usize; N]) -> LedRing<N>
Create a new ring with a clock-position-to-physical-index mapping.
clock_map should have N entries mapping logical position to physical LED index.
Sourcepub fn with_rotation(clock_map: &[usize; N], rotation: u8) -> LedRing<N>
pub fn with_rotation(clock_map: &[usize; N], rotation: u8) -> LedRing<N>
Create with a rotation anchor (first lit LED position for Fill patterns).
pub fn set(&mut self, anim: RingAnimation)
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for LedRing<N>
impl<const N: usize> RefUnwindSafe for LedRing<N>
impl<const N: usize> Send for LedRing<N>
impl<const N: usize> Sync for LedRing<N>
impl<const N: usize> Unpin for LedRing<N>
impl<const N: usize> UnsafeUnpin for LedRing<N>
impl<const N: usize> UnwindSafe for LedRing<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more