Adafruit 24 Ch PWM TLC5947 simple 12 channel LED control

Hello all experts
I am not a programmer.
Heres what Im trying to do.
Have a UNO with a Adafruit TLC5947 24 ch PWM board attached.
I need code to simply toggle 12 LEDS in sequence
3 secs on, 1 sec off between. each LED toggles, then the flow Stops
I would also like a digital input for a start switch
Can one of you brainiacs help an old guy out?
I will be featuring this on YT and will plug your help. Thanks

The aim of forum is supporting new members to grow in coding. It's not a factory creating free toys for members.
There's a section where You can pay to get things made for You.
How much have You managed to do so far?

Roger that, I will explore those other areas. Did not mean to overstep my bounds
Currently, I have the board configured with a example test program, not much else

You can post code and schematics and get tips. What's the major obstacle for the moment?
In the top of the section Project Guidance category You find general advice about how this forum works.

Thank you Sir, I will explore that
By the way, My Dad worked on Grand Trunk Railroad, Battle Creek, MI for 15 yrs

1 Like

Nice. I started real railroading on a veteran railroad 50 years ago and I've working as a professional amateur driver the last 9 seasons.

Hello, I figured out the code for the 24 channel PWM
I will be driving 12 DIN mount relays in sequence
The device will be used to automate voltage testing with a DVM
Hands off high voltage testing
Heres the code. Only relay 1 and 2 have the desired timing set.
#include "Adafruit_TLC5947.h"

#define NUM_TLC5974 1

#define data 5
#define clock 3
#define latch 6

#define buttonPin 7 // the number of the pushbutton pin
#define ledPin 13 // the number of the LED pin

Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, data, latch);
void setup() {

Serial.begin(9600);

pinMode(5, OUTPUT);
pinMode(3, OUTPUT);
pinMode(6, OUTPUT);
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {

if (digitalRead(buttonPin) == HIGH) digitalWrite (ledPin, HIGH);
if (digitalRead(buttonPin) == LOW) digitalWrite (ledPin, LOW);
while (digitalRead(buttonPin) == LOW) delay (1);
tlc.begin();
tlc.setPWM(0, 4096);
tlc.write();
delay(3000); //Time ON
tlc.setPWM(0, 0);
tlc.write();
delay(500); //Time OFF
tlc.setPWM(1, 4096);
tlc.write();
delay(3000);
tlc.setPWM(1, 0);
tlc.write();
delay(500);
tlc.setPWM(2, 4096);
tlc.write();
delay(1000);
tlc.setPWM(2, 0);
tlc.write();
delay(500);
tlc.setPWM(3, 4096);
tlc.write();
delay(1000);
tlc.setPWM(3, 0);
tlc.write();
delay(500);
tlc.setPWM(4, 4096);
tlc.write();
delay(1000);
tlc.setPWM(4, 0);
tlc.write();
delay(500);
tlc.setPWM(5, 4096);
tlc.write();
delay(1000);
tlc.setPWM(5, 0);
tlc.write();
delay(500);
tlc.setPWM(6, 4096);
tlc.write();
delay(1000);
tlc.setPWM(6, 0);
tlc.write();
delay(500);
tlc.setPWM(7, 4096);
tlc.write();
delay(1000);
tlc.setPWM(7, 0);
tlc.write();
delay(500);
tlc.setPWM(8, 4096);
tlc.write();
delay(1000);
tlc.setPWM(8, 0);
tlc.write();
delay(500);
tlc.setPWM(9, 4096);
tlc.write();
delay(1000);
tlc.setPWM(9, 0);
tlc.write();
delay(500);
tlc.setPWM(10, 4096);
tlc.write();
delay(1000);
tlc.setPWM(10, 0);
tlc.write();
delay(500);
tlc.setPWM(11, 4096);
tlc.write();
delay(1000);
tlc.setPWM(11, 0);
tlc.write();
delay(500);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.