48 lines
802 B
Plaintext
48 lines
802 B
Plaintext
|
#include <FastGPIO.h>
|
||
|
#define APA102_USE_FAST_GPIO
|
||
|
|
||
|
#include <APA102.h>
|
||
|
|
||
|
// Define which pins to use.
|
||
|
const uint8_t dataPin = 10;
|
||
|
const uint8_t clockPin = 11;
|
||
|
|
||
|
const uint16_t led_count = 112;
|
||
|
|
||
|
// Create an object for writing to the LED strip.
|
||
|
APA102<dataPin, clockPin> ledStrip;
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
for (int i = 0; i < led_count; i++)
|
||
|
{
|
||
|
color_buffer[i] = rgb_color(255, 0, 0);
|
||
|
}
|
||
|
|
||
|
ledStrip.write(color_buffer, led_count, brightness);
|
||
|
|
||
|
delay(1000);
|
||
|
|
||
|
for (int i = 0; i < led_count; i++)
|
||
|
{
|
||
|
color_buffer[i] = rgb_color(0, 255, 0);
|
||
|
}
|
||
|
|
||
|
ledStrip.write(color_buffer, led_count, brightness);
|
||
|
|
||
|
delay(1000);
|
||
|
|
||
|
for (int i = 0; i < led_count; i++)
|
||
|
{
|
||
|
color_buffer[i] = rgb_color(0, 0, 255);
|
||
|
}
|
||
|
|
||
|
ledStrip.write(color_buffer, led_count, brightness);
|
||
|
|
||
|
delay(1000);
|
||
|
}
|