FastLED 3.9.7
Loading...
Searching...
No Matches
TeensyParallel.ino
1
2// This is an prototype example for the ObjectFLED library for massive pins on teensy40/41.
3
4
5#if !defined(__IMXRT1062__) // Teensy 4.0/4.1 only.
6void setup() {}
7void loop() {}
8#else
9
10#include <Arduino.h>
11#include "FastLED.h"
12
13#include "third_party/object_fled/src/ObjectFLED.h"
14
15// just one pin
16#define NUM_CHANNELS 1
17#define NUM_LEDS_PER_STRIP 1
18
19byte pinList[NUM_CHANNELS] = {1};
20CRGB leds[NUM_CHANNELS * NUM_LEDS_PER_STRIP];
21ObjectFLED driver(NUM_CHANNELS * NUM_LEDS_PER_STRIP, leds, CORDER_RGB, NUM_CHANNELS, pinList);
22
23void setup() {
24 Serial.begin(9600);
25 driver.begin(1.0, 250); // zero overclock, 250uS LED latch delay (WS2812-V5B)
26}
27
28
29
30void blink(CRGB color, int times) {
31 for (int i = 0; i < times; i++) {
32 fill_solid(leds, NUM_CHANNELS * NUM_LEDS_PER_STRIP, color);
33 driver.show();
34 delay(500);
35 fill_solid(leds, NUM_CHANNELS * NUM_LEDS_PER_STRIP, CRGB::Black);
36 driver.show();
37 delay(500);
38 }
39}
40
41void loop() {
42 Serial.println("Blinking...");
43 blink(CRGB::Red, 1);
44 blink(CRGB::Green, 2);
45 blink(CRGB::Blue, 3);
46}
47
48#endif // __IMXRT1062__
central include file for FastLED, defines the CFastLED class/object
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
@ Green
Definition crgb.h:544
@ Blue
Definition crgb.h:498
@ Red
Definition crgb.h:608
@ Black
Definition crgb.h:496