FastLED 3.9.3
|
General purpose wave generator functions.
Functions | |
LIB8STATIC uint8_t | triwave8 (uint8_t in) |
Triangle wave generator. | |
LIB8STATIC uint8_t | quadwave8 (uint8_t in) |
Quadratic waveform generator. | |
LIB8STATIC uint8_t | cubicwave8 (uint8_t in) |
Cubic waveform generator. | |
LIB8STATIC uint8_t | squarewave8 (uint8_t in, uint8_t pulsewidth=128) |
Square wave generator. | |
LIB8STATIC uint8_t cubicwave8 | ( | uint8_t | in | ) |
Cubic waveform generator.
Spends visibly more time at the limits than "sine" does. Spends just a little more time at the limits than "sine" does.
S-shaped wave generator (like "sine"). Useful for turning a one-byte "counter" value into a one-byte oscillating value that moves smoothly up and down, with an "acceleration" and "deceleration" curve.
This is even faster than "sin8()", and has a slightly different curve shape.
Definition at line 773 of file lib8tion.h.
LIB8STATIC uint8_t quadwave8 | ( | uint8_t | in | ) |
Quadratic waveform generator.
Spends just a little more time at the limits than "sine" does.
S-shaped wave generator (like "sine"). Useful for turning a one-byte "counter" value into a one-byte oscillating value that moves smoothly up and down, with an "acceleration" and "deceleration" curve.
This is even faster than "sin8()", and has a slightly different curve shape.
Definition at line 765 of file lib8tion.h.
LIB8STATIC uint8_t squarewave8 | ( | uint8_t | in, |
uint8_t | pulsewidth = 128 ) |
Square wave generator.
Useful for turning a one-byte ever-increasing value into a one-byte value that is either 0 or 255. The width of the output "pulse" is determined by the pulsewidth argument:
The output looking like:
in | input value |
pulsewidth | width of the output pulse |
Definition at line 802 of file lib8tion.h.
LIB8STATIC uint8_t triwave8 | ( | uint8_t | in | ) |
Triangle wave generator.
Useful for turning a one-byte ever-increasing value into a one-byte value that oscillates up and down.
On AVR this function takes just three cycles.
Definition at line 746 of file lib8tion.h.