I am making a custom wall-clock, and need the Arduino (Uno or Nano) to connect to a DS1302 real time clock module and a WS2811 LED chain.
So I’m using DS1302 for the clock, and FastLED for the lights. Individually these two libraries work fine, so I can either echo the time to the serial console, or I can drive the LEDs as I need.
But when I combine them there is some conflict happening and I get no LED output. The LED data goes over pin 6 and the clock uses pins 2,3,4 (these pins are customisable in code).
Even just adding a DS1302 initialisation to a working FastLED sketch causes no more LED output
#include <FastLED.h>
#include <DS1302.h>
#define NUM_LEDS 50
#define DATA_PIN 6
// Init the DS1302 - stops LEDs working
DS1302 rtc(2, 3, 4);
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
for (int i=0; i<NUM_LEDS;i++) {
leds[i] = CRGB::Red;
}
FastLED.show();
delay(100);
}
What are my troubleshooting steps - should I try alternative libraries, or could I dig into the libraries themselves and see what hardware resources they might be using?
I guess as both the lights and the clock probably operate over a serial protocol, it could be a conflict with the serial drivers - maybe both using the same time-critical operations.
Edit: inserted sketch which demonstrates the issue