add led_test
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
#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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user