Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!




Assistance with Pro...
 
Share:
Notifications
Clear all

[Solved] Assistance with Programming 4x 7 Segment LED Scoreboard with Arduino Nano and 4x 74HC595 Shift Registers

10 Posts
2 Users
0 Likes
2,426 Views
(@becauseracecar)
Active Member
Joined: 4 years ago
Posts: 5
Topic starter  

Hi Guys, new to Arduino but I've built an LED Strip Light Scoreboard (4x Digits/7 Segments per digit).

Each 7 Segment Digit is connected to a 74HC595 shift register, in total I have 4 shift registers which are daisy chained and connected to an Arduino Nano.

Having some struggles programming the shift registers, I've managed to get a test code uploaded which is cycling through each segment individually (which is great)… but now I need to be able to program each of the numbers using both an IR Remote and also "UP/DOWN" buttons for each side of the scoring.

I've been looking at a few projects people have done previously but their coding is not using a Arduino Nano and not really using shift registers how they can be used (daisychained).

Would really appreciate any help that you guys can provide to get this sketch all working.. it's quite a long sketch currently so not sure how to add it here (happy to do so if someone can tell me how though).

Cheers!
Brendo


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2660
 

May I ask why you used a shift register?
Just wondering, since you may be able to work with the FastLED library (since you mention LED strips) and have no need for a shift register.
On that note: my experience with shift registers is pretty much zero - I actually had to Google its purpose (interesting Arduino article).

So if this is a LED strip (like a WS2812 etc), then you may be able to subdivide the strip in segment pieces and address them accordingly in code.
You'd need only 1 pin, and a little coding to make sure the segments are properly addressed.


   
ReplyQuote
(@becauseracecar)
Active Member
Joined: 4 years ago
Posts: 5
Topic starter  

Main reason is due to me using the Nano which doesn't have enough digital output pins for 28 individual LED segments...

 

With Shift registers I only need 3 output pins on the Nano to control all the segments, I know this can be done in the configuration I have it setup as I just need some assistance with programming.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2660
 

I see - well, with FastLED you'd need only one pin for all segments. You'll just have to address the segments based on numbers.
For example, LEDs 1-5 is segment 1, LEDs 6-10 is segment 2, etc.

Ideally the segments are the same size/length, so you can define a constant which will be multiplied by n (where n = segment number).
If you're interested in pursuing that option, then I'd be happy to help.

Nothing wrong with you continuing with the shift registers of course, but unfortunately, my lack of experience with shift registers is not going to be helpful 😔 


   
ReplyQuote
(@becauseracecar)
Active Member
Joined: 4 years ago
Posts: 5
Topic starter  

Thanks for letting me know, unfortunately as I've already built the whole board I really would like to stay with the shift registers.

I know someone out there would be able to see what I need to adjust in the code very easily.

What I'm basing it off currently is below, however the code it is based on is still mostly present in regards to defining the outputs... it needs to be adjusted to shift out to each of the registers which I'm struggling to work out how to do. If i can get one side working (00-99) then I should be able to mimmick the code to the other side of the board as effectively they operate as two separate entitities.

 

#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>
#include <XC3718_codes.h>

/* Scoreboard Version 7.0 - FINAL
This is the code for a Softball scoreboard keeping double
digit score for visitor and home, innings, and outs.
Using the IR Remote library from:
---------------------------------------------------------------
IR Remote
http://arduino-info.wikispaces.com/IR-RemoteControl
based on code by Ken Shirriff - http://arcfn.com
Get Library at: https://github.com/shirriff/Arduino-IRremote
Unzip folder into Libraries.
RENAME folder "IRremote"

Also very helpful for use of the IR remote and the shift registers:
http://www.yourwarrantyisvoid.com/2012/07/10/hardware-remote-control-your-arduino/
This program controls a 7 segment LED with Shift Registers and IR remote
---------------------------------------------------------------
MY STUFF:
The scoreboard uses 4 Seven-Segment LEDs that are made up of LED strips
They are controlled by an Arduino Nano with 4 shift
registers using 3 pins only.

----------------------------------------------------------------
VISITOR HOME
`_ _ _ _
|_| |_| |_| |_|
|_| |_| |_| |_|
tens ones tens ones
`
----------------------------------------------------------------
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 MTP3055VL which in turn allows the current
to flow through to each individual LED strip.
` ___________
` | |
` | MTP3055VL |
` |___________|
` G || D || || S
` || || ||
`To Arduino Pin--|| || ||---to GROUND
' | (+12V)_____________________
' |---To LED Segment_______________|__0___0___0____LED Segment
*/
/* Four (4) 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:
1. B 16. +5V (X = not used)
2. C 15. A
3. D 14. Data
4. E 13. GND
5. F 12. Latch
6. G 11. Clock
7. X 10. +5V
8. 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;

//Pin connected to ST_CP of 74HC595
int latchPin = 3;
//Pin connected to SH_CP of 74HC595
int clockPin = 4;
////Pin connected to DS of 74HC595
int dataPin = 2;

// Assign Shift Register Pins for Data, latch and Clock
int dataPinVT = 14; //Visitor Tens Shift Register
int latchPinVT = 12;
int clkPinVT = 11;
int dataPinVO = 30; //Visitor Ones Shift Register
int latchPinVO = 28;
int clkPinVO = 27;
int dataPinHT = 46; //Home Tens Shift Register
int latchPinHT = 44;
int clkPinHT = 43;
int dataPinHO = 62; //Home Ones Shift Register
int latchPinHO = 60;
int clkPinHO = 59;

// Initialize what will be displayed
int visitorTensDisplay = 0;
int visitorOnesDisplay = 0;
int homeTensDisplay = 0;
int homeOnesDisplay = 0;

// Declare pins as outputs
void setup()
{
pinMode(latchPinVT, OUTPUT);
pinMode(clkPinVT, OUTPUT);
pinMode(dataPinVT, OUTPUT);
pinMode(latchPinVO, OUTPUT);
pinMode(clkPinVO, OUTPUT);
pinMode(dataPinVO, OUTPUT);
pinMode(latchPinHT, OUTPUT);
pinMode(clkPinHT, OUTPUT);
pinMode(dataPinHT, OUTPUT);
pinMode(latchPinHO, OUTPUT);
pinMode(clkPinHO, OUTPUT);
pinMode(dataPinHO, OUTPUT);

// Enable the IR stuff
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
// Initalize the displays

visitorTensDisplay=127;
visitorOnesDisplay=127;
homeTensDisplay=127;
homeOnesDisplay=127;

// Not sure, I think this maps the seven segments
// VISITOR TENS AND ONES
digitalWrite(latchPinVT, LOW);
shiftOut(dataPinVT,clkPinVT,MSBFIRST,visitorTensDisplay);
digitalWrite(latchPinVT, HIGH);

digitalWrite(latchPinVO, LOW);
shiftOut(dataPinVO,clkPinVO,MSBFIRST,visitorOnesDisplay);
digitalWrite(latchPinVO, HIGH);

// HOME TENS AND ONES
digitalWrite(latchPinHT, LOW);
shiftOut(dataPinHT,clkPinHT,MSBFIRST,homeTensDisplay);
digitalWrite(latchPinHT, HIGH);

digitalWrite(latchPinHO, LOW);
shiftOut(dataPinHO,clkPinHO,MSBFIRST,homeOnesDisplay);
digitalWrite(latchPinHO, HIGH);

}

void loop() {
// IR stuff: basically decodes the keypress from the remote in a switch case
if (irrecv.decode(&results)) {

switch (results.value)
{
case 0xFF11EE:
Serial.println("Dog");
break;
case 0xFF619E: // POWER (Resets all all counts to 0)
for(int i=0; i<3; i++){
visitorTensDisplay=127;
visitorOnesDisplay=127;
homeTensDisplay=127;
homeOnesDisplay=127;
delay(1000);
visitorTensDisplay=0;
visitorOnesDisplay=0;
homeTensDisplay=0;
homeOnesDisplay=0;
delay(1000);
}

Serial.println("Power button");
break;
case 0xFFA15E:
Serial.println("Mute");
break;
case 0xFF30CF:
Serial.println("One");
break;
case 0xFF18E7:
Serial.println("Two");
break;
case 0xFF7A85:
Serial.println("Three");
break;
case 0xFF10EF:
Serial.println("Four");
break;
case 0xFF38C7:
Serial.println("Five");
break;
case 0xFF5AA5:
Serial.println("Six");
break;
case 0xFF42BD:
Serial.println("Seven");
break;
case 0xFF4AB5:
Serial.println("Eight");
break;
case 0xFF52AD:
Serial.println("Nine");
break;
case 0xFF6897:
Serial.println("Zero");
break;
case 0xFF629D: // UP (increases the visitor count by one)
visitorCount = visitorCount+1;
if(visitorCount>99){ // after 99 runs, counter goes back to 0
visitorCount = 0;
}
Serial.println("CH");
break;
case 0xFFA25D: // DOWN (decreases the visitor count by one)
visitorCount = visitorCount-1;
if(visitorCount<0){
visitorCount = 0;
}
Serial.println("CH-");
break;
case 0xFF22DD: // LEFT (decreases the home count by one)
homeCount = homeCount-1;
if(homeCount<0){
homeCount=0;
}
Serial.println("<<");
break;
case 0xFF02FD: // RIGHT (increases the home count by one)
homeCount = homeCount+1;
if(homeCount>99){ // after 99 runs, counter goes back to 0 and no negative counts
homeCount = 0;
}
Serial.println(">>");
break;
case 0xFF39C6:
Serial.println("Menu");
break;
case 0xFFF10E:
Serial.println("Display");
break;
case 0xFFC936:
Serial.println("Band");
break;
case 0xFFE916:
Serial.println("Memory");
break;
case 0xFFB946:
Serial.println("Return");
break;
case 0xFF718E:
Serial.println("Radio");
break;
}
delay(100);

// Visitor Count Switch-case, displays Visitor score from 0-99
switch (visitorCount){
case 0:
visitorTensDisplay = 0;
visitorOnesDisplay = 63;
break;
case 1:
visitorTensDisplay = 0;
visitorOnesDisplay = 6;
break;
case 2:
visitorTensDisplay = 0;
visitorOnesDisplay = 91;
break;
case 3:
visitorTensDisplay = 0;
visitorOnesDisplay = 79;
break;
case 4:
visitorTensDisplay = 0;
visitorOnesDisplay = 102;
break;
case 5:
visitorTensDisplay = 0;
visitorOnesDisplay = 109;
break;
case 6:
visitorTensDisplay = 0;
visitorOnesDisplay = 125;
break;
case 7:
visitorTensDisplay = 0;
visitorOnesDisplay = 7;
break;
case 8:
visitorTensDisplay = 0;
visitorOnesDisplay = 127;
break;
case 9:
visitorTensDisplay = 0;
visitorOnesDisplay = 111;
break;
case 10:
visitorTensDisplay = 6;
visitorOnesDisplay = 63;
break;
case 11:
visitorTensDisplay = 6;
visitorOnesDisplay = 6;
break;
case 12:
visitorTensDisplay = 6;
visitorOnesDisplay = 91;
break;
case 13:
visitorTensDisplay = 6;
visitorOnesDisplay = 79;
break;
case 14:
visitorTensDisplay = 6;
visitorOnesDisplay = 102;
break;
case 15:
visitorTensDisplay = 6;
visitorOnesDisplay = 109;
break;
case 16:
visitorTensDisplay = 6;
visitorOnesDisplay = 125;
break;
case 17:
visitorTensDisplay = 6;
visitorOnesDisplay = 7;
break;
case 18:
visitorTensDisplay = 6;
visitorOnesDisplay = 127;
break;
case 19:
visitorTensDisplay = 6;
visitorOnesDisplay = 111;
break;
case 20:
visitorTensDisplay = 91;
visitorOnesDisplay = 63;
break;
case 21:
visitorTensDisplay = 91;
visitorOnesDisplay = 6;
break;
case 22:
visitorTensDisplay = 91;
visitorOnesDisplay = 91;
break;
case 23:
visitorTensDisplay = 91;
visitorOnesDisplay = 79;
break;
case 24:
visitorTensDisplay = 91;
visitorOnesDisplay = 102;
break;
case 25:
visitorTensDisplay = 91;
visitorOnesDisplay = 109;
break;
case 26:
visitorTensDisplay = 91;
visitorOnesDisplay = 125;
break;
case 27:
visitorTensDisplay = 91;
visitorOnesDisplay = 7;
break;
case 28:
visitorTensDisplay = 91;
visitorOnesDisplay = 127;
break;
case 29:
visitorTensDisplay = 91;
visitorOnesDisplay = 111;
break;
case 30:
visitorTensDisplay = 79;
visitorOnesDisplay = 63;
break;
case 31:
visitorTensDisplay = 79;
visitorOnesDisplay = 6;
break;
case 32:
visitorTensDisplay = 79;
visitorOnesDisplay = 91;
break;
case 33:
visitorTensDisplay = 79;
visitorOnesDisplay = 79;
break;
case 34:
visitorTensDisplay = 79;
visitorOnesDisplay = 102;
break;
case 35:
visitorTensDisplay = 79;
visitorOnesDisplay = 109;
break;
case 36:
visitorTensDisplay = 79;
visitorOnesDisplay = 125;
break;
case 37:
visitorTensDisplay = 79;
visitorOnesDisplay = 7;
break;
case 38:
visitorTensDisplay = 79;
visitorOnesDisplay = 127;
break;
case 39:
visitorTensDisplay = 79;
visitorOnesDisplay = 111;
break;
case 40:
visitorTensDisplay = 102;
visitorOnesDisplay = 63;
break;
case 41:
visitorTensDisplay = 102;
visitorOnesDisplay = 6;
break;
case 42:
visitorTensDisplay = 102;
visitorOnesDisplay = 91;
break;
case 43:
visitorTensDisplay = 102;
visitorOnesDisplay = 79;
break;
case 44:
visitorTensDisplay = 102;
visitorOnesDisplay = 102;
break;
case 45:
visitorTensDisplay = 102;
visitorOnesDisplay = 109;
break;
case 46:
visitorTensDisplay = 102;
visitorOnesDisplay = 125;
break;
case 47:
visitorTensDisplay = 102;
visitorOnesDisplay = 7;
break;
case 48:
visitorTensDisplay = 102;
visitorOnesDisplay = 127;
break;
case 49:
visitorTensDisplay = 102;
visitorOnesDisplay = 111;
break;
case 50:
visitorTensDisplay = 109;
visitorOnesDisplay = 63;
break;
case 51:
visitorTensDisplay = 109;
visitorOnesDisplay = 6;
break;
case 52:
visitorTensDisplay = 109;
visitorOnesDisplay = 91;
break;
case 53:
visitorTensDisplay = 109;
visitorOnesDisplay = 79;
break;
case 54:
visitorTensDisplay = 109;
visitorOnesDisplay = 102;
break;
case 55:
visitorTensDisplay = 109;
visitorOnesDisplay = 109;
break;
case 56:
visitorTensDisplay = 109;
visitorOnesDisplay = 125;
break;
case 57:
visitorTensDisplay = 109;
visitorOnesDisplay = 7;
break;
case 58:
visitorTensDisplay = 109;
visitorOnesDisplay = 127;
break;
case 59:
visitorTensDisplay = 109;
visitorOnesDisplay = 111;
break;
case 60:
visitorTensDisplay = 125;
visitorOnesDisplay = 63;
break;
case 61:
visitorTensDisplay = 125;
visitorOnesDisplay = 6;
break;
case 62:
visitorTensDisplay = 125;
visitorOnesDisplay = 91;
break;
case 63:
visitorTensDisplay = 125;
visitorOnesDisplay = 79;
break;
case 64:
visitorTensDisplay = 125;
visitorOnesDisplay = 102;
break;
case 65:
visitorTensDisplay = 125;
visitorOnesDisplay = 109;
break;
case 66:
visitorTensDisplay = 125;
visitorOnesDisplay = 125;
break;
case 67:
visitorTensDisplay = 125;
visitorOnesDisplay = 7;
break;
case 68:
visitorTensDisplay = 125;
visitorOnesDisplay = 127;
break;
case 69:
visitorTensDisplay = 125;
visitorOnesDisplay = 111;
break;
case 70:
visitorTensDisplay = 7;
visitorOnesDisplay = 63;
break;
case 71:
visitorTensDisplay = 7;
visitorOnesDisplay = 6;
break;
case 72:
visitorTensDisplay = 7;
visitorOnesDisplay = 91;
break;
case 73:
visitorTensDisplay = 7;
visitorOnesDisplay = 79;
break;
case 74:
visitorTensDisplay = 7;
visitorOnesDisplay = 102;
break;
case 75:
visitorTensDisplay = 7;
visitorOnesDisplay = 109;
break;
case 76:
visitorTensDisplay = 7;
visitorOnesDisplay = 125;
break;
case 77:
visitorTensDisplay = 7;
visitorOnesDisplay = 7;
break;
case 78:
visitorTensDisplay = 7;
visitorOnesDisplay = 127;
break;
case 79:
visitorTensDisplay = 7;
visitorOnesDisplay = 111;
break;
case 80:
visitorTensDisplay = 127;
visitorOnesDisplay = 63;
break;
case 81:
visitorTensDisplay = 127;
visitorOnesDisplay = 6;
break;
case 82:
visitorTensDisplay = 127;
visitorOnesDisplay = 91;
break;
case 83:
visitorTensDisplay = 127;
visitorOnesDisplay = 79;
break;
case 84:
visitorTensDisplay = 127;
visitorOnesDisplay = 102;
break;
case 85:
visitorTensDisplay = 127;
visitorOnesDisplay = 109;
break;
case 86:
visitorTensDisplay = 127;
visitorOnesDisplay = 125;
break;
case 87:
visitorTensDisplay = 127;
visitorOnesDisplay = 7;
break;
case 88:
visitorTensDisplay = 127;
visitorOnesDisplay = 127;
break;
case 89:
visitorTensDisplay = 127;
visitorOnesDisplay = 111;
break;
case 90:
visitorTensDisplay = 111;
visitorOnesDisplay = 63;
break;
case 91:
visitorTensDisplay = 111;
visitorOnesDisplay = 6;
break;
case 92:
visitorTensDisplay = 111;
visitorOnesDisplay = 91;
break;
case 93:
visitorTensDisplay = 111;
visitorOnesDisplay = 79;
break;
case 94:
visitorTensDisplay = 111;
visitorOnesDisplay = 102;
break;
case 95:
visitorTensDisplay = 111;
visitorOnesDisplay = 109;
break;
case 96:
visitorTensDisplay = 111;
visitorOnesDisplay = 125;
break;
case 97:
visitorTensDisplay = 111;
visitorOnesDisplay = 7;
break;
case 98:
visitorTensDisplay = 111;
visitorOnesDisplay = 127;
break;
case 99:
visitorTensDisplay = 111;
visitorOnesDisplay = 111;
break;
// Home Count Switch-case, displays Home score from 0-99
}
switch (homeCount){
case 0:
homeTensDisplay = 0;
homeOnesDisplay = 63;
break;
case 1:
homeTensDisplay = 0;
homeOnesDisplay = 6;
break;
case 2:
homeTensDisplay = 0;
homeOnesDisplay = 91;
break;
case 3:
homeTensDisplay = 0;
homeOnesDisplay = 79;
break;
case 4:
homeTensDisplay = 0;
homeOnesDisplay = 102;
break;
case 5:
homeTensDisplay = 0;
homeOnesDisplay = 109;
break;
case 6:
homeTensDisplay = 0;
homeOnesDisplay = 125;
break;
case 7:
homeTensDisplay = 0;
homeOnesDisplay = 7;
break;
case 8:
homeTensDisplay = 0;
homeOnesDisplay = 127;
break;
case 9:
homeTensDisplay = 0;
homeOnesDisplay = 111;
break;
case 10:
homeTensDisplay = 6;
homeOnesDisplay = 63;
break;
case 11:
homeTensDisplay = 6;
homeOnesDisplay = 6;
break;
case 12:
homeTensDisplay = 6;
homeOnesDisplay = 91;
break;
case 13:
homeTensDisplay = 6;
homeOnesDisplay = 79;
break;
case 14:
homeTensDisplay = 6;
homeOnesDisplay = 102;
break;
case 15:
homeTensDisplay = 6;
homeOnesDisplay = 109;
break;
case 16:
homeTensDisplay = 6;
homeOnesDisplay = 125;
break;
case 17:
homeTensDisplay = 6;
homeOnesDisplay = 7;
break;
case 18:
homeTensDisplay = 6;
homeOnesDisplay = 127;
break;
case 19:
homeTensDisplay = 6;
homeOnesDisplay = 111;
break;
case 20:
homeTensDisplay = 91;
homeOnesDisplay = 63;
break;
case 21:
homeTensDisplay = 91;
homeOnesDisplay = 6;
break;
case 22:
homeTensDisplay = 91;
homeOnesDisplay = 91;
break;
case 23:
homeTensDisplay = 91;
homeOnesDisplay = 79;
break;
case 24:
homeTensDisplay = 91;
homeOnesDisplay = 102;
break;
case 25:
homeTensDisplay = 91;
homeOnesDisplay = 109;
break;
case 26:
homeTensDisplay = 91;
homeOnesDisplay = 125;
break;
case 27:
homeTensDisplay = 91;
homeOnesDisplay = 7;
break;
case 28:
homeTensDisplay = 91;
homeOnesDisplay = 127;
break;
case 29:
homeTensDisplay = 91;
homeOnesDisplay = 111;
break;
case 30:
homeTensDisplay = 79;
homeOnesDisplay = 63;
break;
case 31:
homeTensDisplay = 79;
homeOnesDisplay = 6;
break;
case 32:
homeTensDisplay = 79;
homeOnesDisplay = 91;
break;
case 33:
homeTensDisplay = 79;
homeOnesDisplay = 79;
break;
case 34:
homeTensDisplay = 79;
homeOnesDisplay = 102;
break;
case 35:
homeTensDisplay = 79;
homeOnesDisplay = 109;
break;
case 36:
homeTensDisplay = 79;
homeOnesDisplay = 125;
break;
case 37:
homeTensDisplay = 79;
homeOnesDisplay = 7;
break;
case 38:
homeTensDisplay = 79;
homeOnesDisplay = 127;
break;
case 39:
homeTensDisplay = 79;
homeOnesDisplay = 111;
break;
case 40:
homeTensDisplay = 102;
homeOnesDisplay = 63;
break;
case 41:
homeTensDisplay = 102;
homeOnesDisplay = 6;
break;
case 42:
homeTensDisplay = 102;
homeOnesDisplay = 91;
break;
case 43:
homeTensDisplay = 102;
homeOnesDisplay = 79;
break;
case 44:
homeTensDisplay = 102;
homeOnesDisplay = 102;
break;
case 45:
homeTensDisplay = 102;
homeOnesDisplay = 109;
break;
case 46:
homeTensDisplay = 102;
homeOnesDisplay = 125;
break;
case 47:
homeTensDisplay = 102;
homeOnesDisplay = 7;
break;
case 48:
homeTensDisplay = 102;
homeOnesDisplay = 127;
break;
case 49:
homeTensDisplay = 102;
homeOnesDisplay = 111;
break;
case 50:
homeTensDisplay = 109;
homeOnesDisplay = 63;
break;
case 51:
homeTensDisplay = 109;
homeOnesDisplay = 6;
break;
case 52:
homeTensDisplay = 109;
homeOnesDisplay = 91;
break;
case 53:
homeTensDisplay = 109;
homeOnesDisplay = 79;
break;
case 54:
homeTensDisplay = 109;
homeOnesDisplay = 102;
break;
case 55:
homeTensDisplay = 109;
homeOnesDisplay = 109;
break;
case 56:
homeTensDisplay = 109;
homeOnesDisplay = 125;
break;
case 57:
homeTensDisplay = 109;
homeOnesDisplay = 7;
break;
case 58:
homeTensDisplay = 109;
homeOnesDisplay = 127;
break;
case 59:
homeTensDisplay = 109;
homeOnesDisplay = 111;
break;
case 60:
homeTensDisplay = 125;
homeOnesDisplay = 63;
break;
case 61:
homeTensDisplay = 125;
homeOnesDisplay = 6;
break;
case 62:
homeTensDisplay = 125;
homeOnesDisplay = 91;
break;
case 63:
homeTensDisplay = 125;
homeOnesDisplay = 79;
break;
case 64:
homeTensDisplay = 125;
homeOnesDisplay = 102;
break;
case 65:
homeTensDisplay = 125;
homeOnesDisplay = 109;
break;
case 66:
homeTensDisplay = 125;
homeOnesDisplay = 125;
break;
case 67:
homeTensDisplay = 125;
homeOnesDisplay = 7;
break;
case 68:
homeTensDisplay = 125;
homeOnesDisplay = 127;
break;
case 69:
homeTensDisplay = 125;
homeOnesDisplay = 111;
break;
case 70:
homeTensDisplay = 7;
homeOnesDisplay = 63;
break;
case 71:
homeTensDisplay = 7;
homeOnesDisplay = 6;
break;
case 72:
homeTensDisplay = 7;
homeOnesDisplay = 91;
break;
case 73:
homeTensDisplay = 7;
homeOnesDisplay = 79;
break;
case 74:
homeTensDisplay = 7;
homeOnesDisplay = 102;
break;
case 75:
homeTensDisplay = 7;
homeOnesDisplay = 109;
break;
case 76:
homeTensDisplay = 7;
homeOnesDisplay = 125;
break;
case 77:
homeTensDisplay = 7;
homeOnesDisplay = 7;
break;
case 78:
homeTensDisplay = 7;
homeOnesDisplay = 127;
break;
case 79:
homeTensDisplay = 7;
homeOnesDisplay = 111;
break;
case 80:
homeTensDisplay = 127;
homeOnesDisplay = 63;
break;
case 81:
homeTensDisplay = 127;
homeOnesDisplay = 6;
break;
case 82:
homeTensDisplay = 127;
homeOnesDisplay = 91;
break;
case 83:
homeTensDisplay = 127;
homeOnesDisplay = 79;
break;
case 84:
homeTensDisplay = 127;
homeOnesDisplay = 102;
break;
case 85:
homeTensDisplay = 127;
homeOnesDisplay = 109;
break;
case 86:
homeTensDisplay = 127;
homeOnesDisplay = 125;
break;
case 87:
homeTensDisplay = 127;
homeOnesDisplay = 7;
break;
case 88:
homeTensDisplay = 127;
homeOnesDisplay = 127;
break;
case 89:
homeTensDisplay = 127;
homeOnesDisplay = 111;
break;
case 90:
homeTensDisplay = 111;
homeOnesDisplay = 63;
break;
case 91:
homeTensDisplay = 111;
homeOnesDisplay = 6;
break;
case 92:
homeTensDisplay = 111;
homeOnesDisplay = 91;
break;
case 93:
homeTensDisplay = 111;
homeOnesDisplay = 79;
break;
case 94:
homeTensDisplay = 111;
homeOnesDisplay = 102;
break;
case 95:
homeTensDisplay = 111;
homeOnesDisplay = 109;
break;
case 96:
homeTensDisplay = 111;
homeOnesDisplay = 125;
break;
case 97:
homeTensDisplay = 111;
homeOnesDisplay = 7;
break;
case 98:
homeTensDisplay = 111;
homeOnesDisplay = 127;
break;
case 99:
homeTensDisplay = 111;
homeOnesDisplay = 111;
break;
}
digitalWrite(latchPinVT, LOW);
shiftOut(dataPinVT,clkPinVT,MSBFIRST,visitorTensDisplay);
digitalWrite(latchPinVT, HIGH);

digitalWrite(latchPinVO, LOW);
shiftOut(dataPinVO,clkPinVO,MSBFIRST,visitorOnesDisplay);
digitalWrite(latchPinVO, HIGH);

digitalWrite(latchPinHT, LOW);
shiftOut(dataPinHT,clkPinHT,MSBFIRST,homeTensDisplay);
digitalWrite(latchPinHT, HIGH);

digitalWrite(latchPinHO, LOW);
shiftOut(dataPinHO,clkPinHO,MSBFIRST,homeOnesDisplay);
digitalWrite(latchPinHO, HIGH);
//IR STUFF
irrecv.resume(); // Receive the next value
}
}


   
ReplyQuote


 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2660
 

That's understandable 😊 👍 

Like I said before: I unfortunately have no experience using shift registers 😕

I assume you've read this Arduino ShiftOut article (it has some examples it seems)?
AdaFruit has an article as well on that topic. 


   
ReplyQuote
(@becauseracecar)
Active Member
Joined: 4 years ago
Posts: 5
Topic starter  

Have read a few articles yes, but unfortunately they still don't quite make 100% sense to me in how I need to modify my current script to make this work.

Hoping someone reads this post and can assist me with my specific sketch


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2660
 

I just did an attempt as well, but have to admit (not having a 595 laying around and not having a purpose for it makes it hard to play with it) that it is a little bit confusing. 🤔 

The simplest code I could find was this one at AdaFruit which makes the 595 shift output from Q0 to Q7.


   
ReplyQuote
(@becauseracecar)
Active Member
Joined: 4 years ago
Posts: 5
Topic starter  

What I think I might do, is wire in the hard buttons and try and focus on just getting one side of the board to work (00-99)... If I can get that working then the other side should be a mirror image... as really they are treated as independent numbers anyway.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2660
 

I'm sorry that I don't have a good answer for you. 😔 
If you figure this out, would you mind posting your findings? I'm sure other users may benefit from this. 😊 


   
ReplyQuote


Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: