FastLED
3.9.15
Loading...
Searching...
No Matches
RGBCalibrate.ino
Go to the documentation of this file.
1
4
5
#include "
FastLED.h
"
6
7
9
//
10
// RGB Calibration code
11
//
12
// Use this sketch to determine what the RGB ordering for your chipset should be. Steps for setting up to use:
13
14
// * Uncomment the line in setup that corresponds to the LED chipset that you are using. (Note that they
15
// all explicitly specify the RGB order as RGB)
16
// * Define DATA_PIN to the pin that data is connected to.
17
// * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin
18
// * Compile/upload/run the sketch
19
20
// You should see six leds on. If the RGB ordering is correct, you should see 1 red led, 2 green
21
// leds, and 3 blue leds. If you see different colors, the count of each color tells you what the
22
// position for that color in the rgb orering should be. So, for example, if you see 1 Blue, and 2
23
// Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green).
24
25
// You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering
26
// and it should come out correctly, 1 red, 2 green, and 3 blue.
27
//
29
30
#define NUM_LEDS 7
31
32
// For led chips like WS2812, which have a data line, ground, and power, you just
33
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
34
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
35
// Clock pin only needed for SPI based chipsets when not using hardware SPI
36
#define DATA_PIN 3
37
#define CLOCK_PIN 13
38
39
CRGB
leds
[
NUM_LEDS
];
40
41
void
setup
() {
42
// sanity check delay - allows reprogramming if accidently blowing power w/leds
43
delay(2000);
44
45
// Uncomment/edit one of the following lines for your leds arrangement.
46
// ## Clockless types ##
47
// FastLED.addLeds<SM16703, DATA_PIN, RGB>(leds, NUM_LEDS);
48
// FastLED.addLeds<TM1829, DATA_PIN, RGB>(leds, NUM_LEDS);
49
// FastLED.addLeds<TM1812, DATA_PIN, RGB>(leds, NUM_LEDS);
50
// FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
51
// FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
52
// FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
53
// FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
54
// FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
55
// FastLED.addLeds<UCS1904, DATA_PIN, RGB>(leds, NUM_LEDS);
56
// FastLED.addLeds<UCS2903, DATA_PIN, RGB>(leds, NUM_LEDS);
57
// FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
58
// FastLED.addLeds<WS2852, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
59
// FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
60
// FastLED.addLeds<GS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
61
// FastLED.addLeds<SK6812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
62
// FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
63
// FastLED.addLeds<APA106, DATA_PIN, RGB>(leds, NUM_LEDS);
64
// FastLED.addLeds<PL9823, DATA_PIN, RGB>(leds, NUM_LEDS);
65
// FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
66
// FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
67
// FastLED.addLeds<WS2813, DATA_PIN, RGB>(leds, NUM_LEDS);
68
// FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
69
// FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
70
// FastLED.addLeds<GE8822, DATA_PIN, RGB>(leds, NUM_LEDS);
71
// FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
72
// FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
73
// FastLED.addLeds<LPD1886, DATA_PIN, RGB>(leds, NUM_LEDS);
74
// FastLED.addLeds<LPD1886_8BIT, DATA_PIN, RGB>(leds, NUM_LEDS);
75
// ## Clocked (SPI) types ##
76
// FastLED.addLeds<LPD6803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
77
// FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
78
// FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
79
// FastLED.addLeds<WS2803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
80
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
81
// FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
82
// FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
83
// FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
84
// FastLED.addLeds<SK9822, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
85
86
// FastLED.setBrightness(CRGB(255,255,255));
87
}
88
89
void
loop
() {
90
leds
[0] =
CRGB
(255,0,0);
91
leds
[1] =
CRGB
(0,255,0);
92
leds
[2] =
CRGB
(0,255,0);
93
leds
[3] =
CRGB
(0,0,255);
94
leds
[4] =
CRGB
(0,0,255);
95
leds
[5] =
CRGB
(0,0,255);
96
leds
[6] =
CRGB
(0,0,0);
97
FastLED
.show();
98
delay(1000);
99
}
setup
void setup()
Definition
AnalogOutput.ino:61
loop
void loop()
Definition
AnalogOutput.ino:50
leds
CRGB leds[NUM_LEDS]
Definition
Apa102.ino:11
NUM_LEDS
#define NUM_LEDS
Definition
Apa102.ino:6
FastLED
CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp:58
FastLED.h
central include file for FastLED, defines the CFastLED class/object
CRGB
Representation of an RGB pixel (Red, Green, Blue)
Definition
crgb.h:54
examples
RGBCalibrate
RGBCalibrate.ino
Generated on Fri Apr 18 2025 03:39:31 for FastLED by
1.13.2