3x3x3 LED Cube Malfunction

Hello Hackers and electronic wizs :

Recently I embarked on my first Arduino project, an Led 3x3x3 cube( Heck, it’s my first electronics project :blush:). I couldn’t find many tutorials that I completely understood but I did find this one Arduino - LED Cube 3x3x3 [Full Tutorial] - YouTube. I followed all the steps and successfully built the cube (I ended up using 2N3906 transistors) . I tried to upload the code below but there was something wrong with it and (as I have no idea how to code or how to fix code) I gave up. If you guys could give me some idea how I can fix that it would be much appreciated XD. Another slight problem with the cube; There are four LEDs in the bottom row that are very bright compared to the other led’s. Any idea why that happens?

Any input it greatly appreciated!

Thanks!

Sorry if this is in the wrong section BTW. I thought this was probably the best :roll_eyes:

ledcube.pde (4.57 KB)

(deleted)

( @spycatcher2k There is an #include - seem OK to me )

WireEverywhere - You wrote

I tried to upload the code below but there was something wrong with it

What - it displayed the Pong game instead? Or did the upload fail (no program uploaded at all)

In other words - what was not working / displaying as you expected? You must state What you hoped would happen (and why, ie. what did you do) and what actually happened.

You also write

There are four LEDs in the bottom row that are very bright compared to the other led’s

Well, could be your wiring, could be a bad transistor, could be the program. Now you did include the code, but please also include the cube library you are using, so we who are trying to help do not first have to find it (and possibly find a differnet version)

Which brings me back to the first question - apperently some LEDs are lit up, but is it displaying some apttern or is that just a static display … or an artifact from a previous uploaded unrelated program

(deleted)

Msquare: ( @spycatcher2k There is an #include - seem OK to me )

WireEverywhere - You wrote

I tried to upload the code below but there was something wrong with it

What - it displayed the Pong game instead? Or did the upload fail (no program uploaded at all)

In other words - what was not working / displaying as you expected? You must state What you hoped would happen (and why, ie. what did you do) and what actually happened.

When I try to upload the code onto the Arduino I get an error message saying:

ledcube:15: error: 'LedCube' does not name a type ledcube.pde: In function 'void loop()': ledcube:48: error: 'cubeFrame' was not declared in this scope ledcube:48: error: 'f' was not declared in this scope ledcube:48: error: expected primary-expression before ']' token ledcube:48: error: expected primary-expression before '{' token ledcube:48: error: expected ;' before '{' token ledcube:195: error: expected}' at end of input

Msquare: You also write

There are four LEDs in the bottom row that are very bright compared to the other led's

Well, could be your wiring, could be a bad transistor, could be the program. Now you did include the code, but please also include the cube library you are using, so we who are trying to help do not first have to find it (and possibly find a differnet version)

Which brings me back to the first question - apperently some LEDs are lit up, but is it displaying some apttern or is that just a static display ... or an artifact from a previous uploaded unrelated program

What file is the "library"? :blush: Inside the folder I downloaded there is the file I previously uploaded then "Keywords.txt" , "LedCube.ccp", "LedCube.h", "Newfix.h", and "README.md" files.

All the LED's are lit at one point but the ones on the top layer are very dim, the one on the centre layer are slightly brighter, and then there are four led on the bottom layer that are very bright compared to the others.

spycatcher2k: Included in the post, rather than the sketch. As in the #include is valid, but the is no library installed to include the files from. Hope this helps ;-)

I don't know what you mean...sorry. =(

(deleted)

The bottom row is where your power is entering. As it goes through the series of LEDs, the voltage drops due to the resistance of wires and what not. You would have to power each row individually for them all to be properly powered, but even then you may see a slight difference in the brightness of the first LED on the row and the last.

You don’t need extra power sources , just power the individual rows in parallell. Split your power and ground wires into three to power each of the three (or more? title looked like 3x3x3 cube, but you mentioned a row of four…) and everything should look cleaner.

Alright, so after some minor face palming :sweat_smile: I realized I wasn't using a library. I uploaded and now the program works flawlessly. Unfortunately I still have an issue with the LED's not being bright enough. If you guys do have suggestions please try to describe in lame-mans terms. I'm still pretty clueless when it comes to all this stuff.