Hello I am trying to do a very simple task of individually controlling the RGB Channels of an LED using the P9813 LED Driver. The Driver Module I have is the following from amazon.
RGB LED Driver
Are my Clock and Data Pins incorrect? Are there specific pins that should be used? Anyone has any suggestions or experience with working with this module?
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 51
#define CLOCK_PIN 53
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
Serial.begin(9600);
}
void loop() {
// Turn the LED on, then pause
leds[0].r = 128;
leds[0].g = 0;
leds[0].b = 0;
FastLED.show();
delay(1000);
}