Hi all -- Noob submits & hopes you all can help. I am building a Pinewood Derby timer system for my Cub Scout Pack. I am trying to control 4 individual digit LEDs (LSD23265) common anode with 9V. I need to be able to send place order (i.e. 1st, 2nd, 3rd, 4th) from Nano. The Nano gets data from another Uno connected via serial (A4, A5). Based on research around net I learned that best option for this would be TLC5916 const current LED drivers. But, for the life of me I can't get it all to work, even with just a basic LED connected to the output pins. Here's my setup so far:
Arduino | TLC5916
Pin 11 Pin2 (SDI)
Pin 13 Pin3 (CLK)
Pin 10 Pin 4 (LE)
Pin 7 Pin 13 (OE)
TLC5916 ground pin (12) connected via 220ohm R.
I copied code from another posting in forum (forum.arduino.cc/index.php?topic=65492.0) and have attempted to get it to work (below). I have tried SPI.H, TLC5917.h libraries without success. I attempted to add line in posting regarding LE being added LOW, HIGH, then back to LOW.
#include "SPI.h"
int SDI=11;
int CLK=13;
int LE=10;
int OE=7;
void setup()
{
pinMode(SDI, OUTPUT);
pinMode(OE, OUTPUT);
pinMode(LE, OUTPUT);
SPI.begin();
SPI.setBitOrder(LSBFIRST);
}
void setBLUE(int Bluevalue)
{
digitalWrite(LE, LOW);
digitalWrite(OE, HIGH);
digitalWrite(SDI, LOW);
SPI.transfer(0); // send command byte
SPI.transfer(Bluevalue); // send value (0~255)
digitalWrite(LE, HIGH);
digitalWrite(SDI, HIGH);
digitalWrite(OE, LOW);
digitalWrite(LE, LOW);
}
void loop()
{
setBLUE(255); // Turn all 8 leds on
delay(500);
setBLUE(0); // Turn all 8 leds off
delay(500);
}
You can see that the noob is WAY out of his element here and clearly can't make sense of the TLC5916 configuration. It is worth noting that I figured out all on my own how to wire up a 74HC595 but also learned that it won't work here with 9V (no pretty blue smoke today).
So my begging question is: how do I wire up the LED LSD23265 to TLC5916 so i can control each digit independently from Nano? What are the pin connections necessary and what is the correct code? Lastly, I need to (of course) conserve pins on the Nano, I'd hoped to serial them together via A4/A5, but again, can't make that all come together.
Many thanks in advance - I really appreciate all of your help that I have gleaned over the last few years & am proud to say that this is the first time I am truly stumped. Any help appreciated!