32 "Take a wooden walking stick, wrap dense LEDs around it like a corkscrew. Super simple but very awesome looking."
33 "This assumes the dense 144 LEDs / meter.");
52 int num_leds =
args.num_leds;
53 float leds_per_turn =
args.leds_per_turn;
54 float width_cm =
args.width_cm;
56 const float circumference = leds_per_turn;
57 const float radius = circumference / (2.0 *
PI);
58 const float angle_per_led = 2.0 *
PI / leds_per_turn;
59 const float total_angle_radians = angle_per_led * num_leds;
60 const float total_turns = total_angle_radians / (2.0 *
PI);
61 const float height_per_turn_cm = width_cm;
62 const float height_per_led =
65 const float total_height =
66 height_per_turn_cm * total_turns;
68 for (
int i = 0; i < num_leds; i++) {
69 float angle = i * angle_per_led;
70 float height = (i / leds_per_turn) * height_per_turn_cm;
73 float x = radius * cos(angle);
74 float z = radius * sin(angle);
90 int num_leds =
args.num_leds;
91 float leds_per_turn =
args.leds_per_turn;
92 float width_cm =
args.width_cm;
95 const float circumference = leds_per_turn;
96 const float radius = circumference / (2.0 *
PI);
97 const float angle_per_led = 2.0 *
PI / leds_per_turn;
98 const float height_per_turn_cm = width_cm;
99 const float height_per_led =
105 for (
int i = 0; i < num_leds; i++) {
106 float angle = i * angle_per_led;
107 float r = radius + 10 + i * height_per_led;
110 float x = r * cos(angle);
111 float y = r * sin(angle);
158 uint32_t now = millis();
161 for (
int i = 0; i <
NUM_LEDS; i++) {
174 uint8_t
brightness = map(noise_value, 0, 65535, 0, 255);
176 uint8_t sat = int32_t((
x * 10 +
y * 5 + now / 5)) % 256;
185 uint32_t now = millis();
CFastLED FastLED
Global LED strip management instance.
@ APA102HD
APA102 LED chipset with 5-bit gamma correction.
central include file for FastLED, defines the CFastLED class/object
fl::vector< vec3f > makeCorkScrew(corkscrew_args args=corkscrew_args())
UITitle festivalStickTitle("Festival Stick")
UIDescription festivalStickDescription("Take a wooden walking stick, wrap dense LEDs around it like a corkscrew. Super simple but very awesome looking." "This assumes the dense 144 LEDs / meter.")
UISlider ledsScale("Leds scale", 0.1f, 0.1f, 1.0f, 0.01f)
CLEDController * addController()
fl::vector< vec3f > mapCorkScrew
ScreenMap makeScreenMap()
UISlider brightness("Brightness", 255, 0, 255, 1)
CLEDController * controller
Base definition for an LED controller.
void push_back(const T &value)
@ BGR
Blue, Green, Red (0210)
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.
void clear(CRGB(&arr)[N])
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)
Implements a simple red square effect for 2D LED grids.
Functions to generate and fill arrays with noise.
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Representation of an RGB pixel (Red, Green, Blue)