FastLED 3.9.3
Loading...
Searching...
No Matches
1653_S3_Apa102_Hardware_Pins.ino
1// https://github.com/FastLED/FastLED/issues/1653
2
3
4#define FASTLED_ALL_PINS_HARDWARE_SPI
5#include <FastLED.h>
6
7#define LED_DI 40 // Data pin for the APA102 LED
8#define LED_CI 39 // Clock pin for the APA102 LED
9#define NUM_LEDS 1 // The number of LEDs in your APA102 strip
10
11// Define the array of leds
12CRGB leds[NUM_LEDS];
13
14void setup()
15{
16 // Initialize the LED stripThe sketch is:
17 FastLED.addLeds<APA102, LED_DI, LED_CI, BGR>(leds, NUM_LEDS);
18 // set master brightness control
20}
21
22void loop()
23{
24 static uint8_t hue = 0;
25 // Set the first led to the current hue
26 leds[0] = CHSV(hue, 255, 255);
27 // Show the leds
28 FastLED.show();
29 // Increase the hue
30 hue++;
31 // Wait a little bit before the next loop
32 delay(20); // This delay controls the speed at which hues change, lower value will cause faster hue rotation.
33}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:33
central include file for FastLED, defines the CFastLED class/object
@ APA102
APA102 LED chipset.
Definition FastLED.h:100
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:722
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:82
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:67
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:11
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39