I am currently making a Scoreboard for my local Rugby Club, it is a 4 Digit 7-Segment Display using 1TPIC6B595 Shift Register per Digit, putting the Shift Registers together in Serial (SEROUT pin 18 of 1st Register to SERIN pin 3 of the 2nd Register etc).
I have run a counter program from Proto-Pic.co.uk, that uses Shifter.h. the program runs well, I can change the varibles to get it to count up using all 4 digits or get all 4 digits counting to 9 together.
What I want to do next is use the top 2 digits for the Home Score and the bottom 2 digit for the Visitors score, then using a remote controller, increase the count by 1 on the Home Score then use another button to increase the Visitor Score. I have seem some sketches to do what I want but their project use the 74HC595 Shifter which only have 16 pins instead of 20 pins on the TPIC6B595, therefore the pin numbers on the sketch doesn't transfer to the TPIC6B595.
How can I write a sketch to display a number that I can then change by editing the sketch?
The shift register pin numbers are not reflected in a sketch, instead you must connect the Arduino pins to the right register pins. See the signal and pin names in the circuit diagrams.
Thanks for the reply,
The problem I have is I have a sketch that someone has written that does what I want, but they have use 74HC595 Shift Registers.
I am trying to work out how it would work with TPIC6B595 Shift Registers as the 74HC Shifters are 16 pin and the TPIC are 20 pin.
I'm stuck with the Assign Shift Register Pins for Data, latch and Clock, in the last paragraph below:
MY STUFF:
The scoreboard uses 5 Seven-Segment LEDs that are made up of LED strips
cut into 6 LED long segments and made up to look like
7-segment LEDs. They are controlled by an Arduino Mega with 5 shift
registers using 3 pins each.
Outs are three LED bunches consisting of 4 columns of 3 LED long segments
of Red LEDs in a square pattern: 0 O O O 0 0 O O 0 0 O O OUTS: 0 O O O 0 0 O O 0 0 O O 0 O O O 0 0 O O 0 0 O O
Each "out" square is connected together in series, utilizing 1 arduino pin
for each out.
VISITOR INNING HOME _ _ _ _ _ |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| tens ones inn tens ones Outs: O O O
The LED strips use 12V for power and the Arduino cannot power that.
A 12V power supply is hooked up directly to +12v of each strip.
Each arduino pin goes to a TIP-120 which in turn allows the current
to flow through to each individual LED strip. ________ | TIP | | 120 | |________| || || || || || || To Arduino Pin--|| || ||---to GROUND ' | (+12V)_____________________ ' |---To LED Segment_______________|__0___0___0____LED Segment */ /* Five (5) Shift Registers are used, 74HC595. Letters indicate segment of 7-Segment LED. A
| |
F B
|G|
| |
E C
|D|
Pin Designation for the shift Register as follows:
B 16. +5V (X = not used)
C 15. A
D 14. Data
E 13. GND
F 12. Latch
G 11. Clock
X 10. +5V
GND 9. X /
/ IR Receiver Pins _____ | | | IR | |_____| | | | | | |
`To Arduino Pin#11 --| | |---to +5V Power
' |
' |---To GROUND
*/ #include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
// Assign Shift Register Pins for Data, latch and Clock
int dataPinVT = 22; //Visitor Tens Shift Register
int latchPinVT = 29;
int clkPinVT = 31;
int dataPinVO = 28; //Visitor Ones Shift Register
int latchPinVO = 26;
int clkPinVO = 24;
int dataPini = 23; //Inning Shift Register
int latchPini = 30;
int clkPini = 32;
int dataPinHT = 47; //Home Tens Shift Register
int latchPinHT = 49;
int clkPinHT = 51;
int dataPinHO = 41; //Home Ones Shift Register
int latchPinHO = 43;
int clkPinHO = 45;
// Assign pins for outs
int out1 = 53;
int out2 = 27;
int out3 = 25;
// Initialize what will be displayed
int visitorTensDisplay = 0;
int visitorOnesDisplay = 0;
int inningDisplay = 0;
int homeTensDisplay = 0;
int homeOnesDisplay = 0;