Hi This Website Is Not Finished

Solder Layer + Test

Solder the LEDs together in layers, the cathodes should all be connected in each layer, the anodes connect in columns. This way, we can turn on each LED individually by setting a column (+ pin) to high and the layer of the desired LED (- pin) to low.

Gotta be careful when soldering, it turns out that LEDs can be destroyed by the heat if you take too long to make a connection.

One of the problems with connecting the LEDs up like this is that we can't turn on two LEDs in two different layers without also turning on the LED in the corresponding column and layer. To get around this, anytime we turn on multiple LEDs we need to turn them on and off really fast one by one, this way, we can have any group of LEDs appear to be on while the rest are off.

I added some copper wire I had lying around to strengthen + attach the layers, would not recommend doing this as removing the lamination is a pain and it looks bad. You can get normal utility wire with no insulation easily enough.

Make sure you test after you use the soldering iron, if one of the LEDs dies it's A LOT easier to replace it now rather than when the cube is finished.

Wiring

I would highly recommend not doing this the same way as me, I initially connected the LEDs expecting to make a cube, but went for a matrix instead. The LEDs i have have short pins which makes soldering more awkward and doesnt allow you to see the separate LEDs very well if it's a cube.

Decided not to do a cube. A 10 x 10 setup looks better. I think for a cube, longer pins or just having the LEDs more spread out would be better.

I only had cardboard on hand at the time, if I could redo this even just with cardboard i would have painted it black. The plan is to cover the LEDs with some translucent cover to diffuse them a bit and hide the horrendous solder blobs.

Soldering on these stripboard type things makes you feel like a solder god. It just goes exactly where you want it to and nowhere else.

This was just as awkward as it looks, I tried to keep some semblance of order keeping the wire colours for matching columns. I also took off the end of the wire and crimped them to the LED pins for more reliable connections. Was too scared to solder them and break an LED.

Code

Oh god I have to clean up the code.

Lots of testing. Testing all the time. LEDs replaced so far: ~4.

                            
                                
                        void square2Row1(int timeDelay, int a, int b, int c, int d, int e) {
                            digitalWrite(40, LOW);  
                            if (a) {digitalWrite(2, HIGH);
                            }
                            if (b) {digitalWrite(3, HIGH);
                            }
                            if (c) {digitalWrite(4, HIGH);
                            }
                            if (d) {digitalWrite(5, HIGH);
                            }
                            if (e) {digitalWrite(6, HIGH);
                            }
                            delay(timeDelay);
                            for (int i = 2; i < 7; i++) {
                                digitalWrite(i, LOW);
                            }
                            digitalWrite(40, HIGH);
                            }                        
                            
                        

This was the basic unit of code I started with. I was in two minds about making a function that could do anything or just making a basic function and reusing it where I could and using other more specific functions to do more complicated things.

The first line sets the negative pins of the specific 5x5 square to LOW, then we go through each LED in our specific row and turn on the ones we want. The timeDelay sets how long the LEDs stay on for. Yes I made 20 functions that look exactly like this. I was young and foolish okay.

The nice thing about having repetitive functions like this is that I can visualise exactly what its going to look like., and can show pretty much whatever I want.

                            
                        time_now = millis();
                        while (millis() < time_now + period) {
                    
                        square2Row4(timeDelay, 0, 1, 1, 1, 1);
                        square2Row3(timeDelay, 0, 1, 1, 1, 1);
                        square2Row2(timeDelay, 0, 1, 1, 1, 1);
                        square2Row1(timeDelay, 0, 1, 1, 1, 1);
                    
                        square3Row4(timeDelay, 1, 1, 1, 1, 0);
                        square3Row3(timeDelay, 1, 1, 1, 1, 0);
                        square3Row2(timeDelay, 1, 1, 1, 1, 0);
                        square3Row1(timeDelay, 1, 1, 1, 1, 0);
                    
                        square0Row2(timeDelay, 0, 1, 1, 1, 1);
                        square0Row3(timeDelay, 0, 1, 1, 1, 1);
                        square0Row4(timeDelay, 0, 1, 1, 1, 1);
                        square0Row5(timeDelay, 0, 1, 1, 1, 1);
                    
                        square1Row2(timeDelay, 1, 1, 1, 1, 0);
                        square1Row3(timeDelay, 1, 1, 1, 1, 0);
                        square1Row4(timeDelay, 1, 1, 1, 1, 0);
                        square1Row5(timeDelay, 1, 1, 1, 1, 0);
                        }
                            
                        
                            
                    void rows(int timeDelay, int rowNo, int arr[10]) {           
                        int a = arr[0];
                        int b = arr[1];
                        int c = arr[2];
                        int d = arr[3];
                        int e = arr[4];
                        int f = arr[5];
                        int g = arr[6];
                        int h = arr[7];
                        int i = arr[8];
                        int j = arr[9];

                        switch (rowNo)
                        {
                        case 0:
                            square0Row1(timeDelay, a, b, c, d, e);
                            square1Row1(timeDelay, f, g, h, i, j);
                            break;
                        case 1:
                            square0Row2(timeDelay, a, b, c, d, e);
                            square1Row2(timeDelay, f, g, h, i, j);
                            break;
                        case 2:
                            square0Row3(timeDelay, a, b, c, d, e);
                            square1Row3(timeDelay, f, g, h, i, j);
                            break;
                        case 3:
                            square0Row4(timeDelay, a, b, c, d, e);
                            square1Row4(timeDelay, f, g, h, i, j);
                            break;
                        case 4:
                            square0Row5(timeDelay, a, b, c, d, e);
                            square1Row5(timeDelay, f, g, h, i, j);
                            break;
                        case 5:
                            square2Row1(timeDelay, a, b, c, d, e);
                            square3Row1(timeDelay, f, g, h, i, j);
                            break;
                        case 6:
                            square2Row2(timeDelay, a, b, c, d, e);
                            square3Row2(timeDelay, f, g, h, i, j);
                            break;
                        case 7:
                            square2Row3(timeDelay, a, b, c, d, e);
                            square3Row3(timeDelay, f, g, h, i, j);
                            break;
                        case 8:
                            square2Row4(timeDelay, a, b, c, d, e);
                            square3Row4(timeDelay, f, g, h, i, j);
                            break;
                        case 9:
                            square2Row5(timeDelay, a, b, c, d, e);
                            square3Row5(timeDelay, f, g, h, i, j);
                            break;
                        }
                    }
                            
                        

Now if I call rows() in a loop i can start getting things like the video below.

Bouncy. Also problem.

When I started getting some patterns going I realised that I had included 0 resistors in this entire project (major panic). And yet nothing was burning? Well. Will come back to this.

Using variable resistors to move paddle for pong (the game pong).

Testing the different ball paths.

Apologies for the potato quality.