Skip to main content

breathing

Function breathing 

Source
fn breathing(
    channel: &Channel<'_, LowSpeed>,
    brightness: u8,
    elapsed_ms: u64,
    period_ms: u64,
)
Expand description

Breathing: raised sine over period_ms, scaled to brightness.

Raised sine (sinf(2π·t − π/2) + 1) / 2 over period_ms, scaled to brightness — starts dark, peaks at half the period, ends dark.