FastLED 3.9.15
Loading...
Searching...
No Matches

◆ squarewave8()

LIB8STATIC u8 fl::squarewave8 ( u8 in,
u8 pulsewidth = 128 )

Square wave generator.

if in < pulsewidth then output is 255 if in >= pulsewidth then output is 0

Parameters
ininput value
pulsewidthwidth of the output pulse
Returns
square wave output

Definition at line 22 of file squarewave.h.

22 {
23 if (in < pulsewidth || (pulsewidth == 255)) {
24 return 255;
25 } else {
26 return 0;
27 }
28}

References FL_NOEXCEPT, and LIB8STATIC.