Some details on the electrical side.... (if you spot anything that looks out of place, please advise, I've never studied this stuff)
First, driving things that light up. Behind each of the 10 holes you can score on is an RGB LED - that's 30 lines to switch on and off. The use of 4 TLC5916 constant current drivers handles this nicely. They are very much like a standard shift register with the added bonus of the constant current part. Then there is the segmented display; 9 units, 16 segments, you do the math. For this, we're driving one column at a time and rapidly switching. So that means only 32 segments have to be dealt with at a time. Oddly, the LED driver circuit needed for the RGB's supports exactly 32 outputs. So we need two of these:
The "Display Controller Addition" part is only needed for driving the segmented displays. Transistors are MPSA56. All resistors are 1k. Caps are .1uF (optional)
All CLK and LE lines are connected together. SDI from first chip is fed from the KL25z. SDO of one chip connects to SDI of the next chip. Resistor values are around 950 - 1k should be fine. (see spec sheet for the formula to use for your LEDs)
Vcc connects to your 5V supply - note that it will have to be beefy enough to drive everything.
The KL25Z pins shown in brownish on the left of diagram (PTD0/1/2)
Outputs I've wired to a 34-line ribbon cable to make things easy.
The game does software PWM, allowing for 255 intensity levels for each line/colour.
For the RGB driver, output 0 is red for first hole, output 1 is greed, 2 is blue. Then hole 2 red, green, blue, etc.
The software has a "test mode" which, among other things, lets you cycle through turning on one line at a time, so you can verify all your connections are good.
For the segmented display driver, all lines are used, 16 for row one, 16 for row two. The mapping of the SDI/CLK/LE lines to the KL25z pins is not as shown (will use PTE2/3, PTB11). Segmented display driver also needs a column driver - the 74HC595 is a good fit for this, and add 5 transistors to source current for each column. This means we can shift out an extra 8 bits and latch it all in one go.
Outputs are wired in sequence to the segments as per this table (hex codes refer to which line to light up, and can be ignored):
J 0X01
A1 0x02
K 0X04
H 0X08
A2 0x10
F 0X20
B 0x40
G2 0X80
G1 0X100
E 0X200
C 0x400
D1 0X800
L 0X1000
N 0X2000
D2 0X4000
M 0X8000
This should make wiring easy, sort of follows pins, top to bottom, left to right. Pin 1 of the seg-disp unit is not connected, so first in the list is the top right pin (pin 24, the J segment), then second from top on right (A1), second from top on left (K), etc. I've coded a table mapping characters to appropriate segments to light up, so it's easy to ask for any text to be displayed. The code also takes care of flipping through the columns.
You can refer to pinout here
https://www.sparkfun.com/datasheets/Components/LED/7-Segment/yetda%20green%20alphanumeric%20S-10012RGU11.pdfQuick note on "test mode" - if you hold both start buttons during power up, it goes into a test mode. Since P1 start is used to move to the next phase of this mode, it's probably best to release P1 start then P2 start as you enter this mode.
It begins by turning all lights to white. If something is wrong, it should show up quickly at this point.
Use left stick down to flip red-green-blue from hole light 1 all the way up to 10. Right down to reset back to light 1 red.
P1 start to go to next mode - test hole switches. Place something metallic by each mag switch and it will turn on the light behind it when detected (display also shows which hole is detected).
P1 start to go to next mode - motor test - just moves motors according to joysticks; simple.
P1 start to exit test mode
I found it handy for testing that wiring is all good, things are powered, etc. More options can be added as needed.
Boot sequence is as such:
initialize hardware
put "power/on" on display
test mode, if start buttons pressed
quick colour cycle of led's
if gate switch not closed, display "No/ball"
wait a few seconds (for r-pi) -- load config and hi-scores if found
initialize game loop with attract mode....