8x8x8 cube programming

Forum for posting topics and questions about anything.
andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube programming

Post by andrew » Tue Sep 08, 2020 8:44 am

That's a very good idea! The only thing is as part of plans to simplify the cubes design, and as nobody seems to be using the spare digital pins for anything, we were considering using them to directly drive the M5456 transistor array. This would then remove the need for the 3 to 8 line decoder altogether. I will make a note of it anyway as it's worth considering.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Tue Sep 08, 2020 1:05 pm

Decisions, decisions !

I think it a shame that more people don't program the cube but I can understand why and I don't recall seeing any queries here about it. In fact I suspect that quite a few people never finish building the cube as it is a daunting and tedious job to put together the LED slices, the PCB being easy in comparison and your proposed change will only remove the need to solder one socket and a row of pins. Whilst I am sure that you want to reduce the BoM cost I suspect that a few pins, one socket and one IC will make that much difference to the cost

For anyone interested in using the spare pins for something, Bluetooth control comes to mind, it would be a shame not to have the ability to add it but I can't remember now whether I knew that spare pins were available when I bought the kit having previously built the 4x4x4 cube

How important is the ability to control the foot LEDs to most people ? You could free up another pin by providing a jumper to turn the feet permanently on or off. Equally, as practically nobody programs the cube I think that you could remove the ICSP header which may make the MOSI pin available for alternative uses

As I said, decisions, decisions !

Good luck with the changes whatever you decide
If you need a beta tester then you know how to contact me :)

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube programming

Post by andrew » Sun Sep 13, 2020 7:59 am

Well an update to the design isn't going to happen for quite a while anyway. What with the current Covid situation we've had to concentrate on just getting orders shipped out and so our (very long) queue of projects has been put on the back burner a bit. The 4x4x4 cube kit is planned to be updated before the 8x8x8 kit anyway.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Sun Sep 13, 2020 12:33 pm

Understood - good luck going forward

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Sat Sep 19, 2020 11:08 am

I have a query about the _Diff() function

I looked at how the function worked whilst trying to track down a problem with a program that I had written not behaving as it should. The problem turned out to be that if the difference between the two numbers sent to _Diff() is 0 then it actually returns 1 instead and this is expressly coded in the function

Code: Select all

	if(result == 0)
		result = 1;
Do you know the reason for this ?

Removing the offending lines appears not to have any deleterious effect on the Line() function which is what I was using when I discovered the problem, but the _Diff() function is used elsewhere in the library and I have not checked any other functions

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube programming

Post by andrew » Sun Sep 20, 2020 7:12 am

It's to stop the possibility of a divide by zero error when calculating the step sizes. Although, I can see that it is making a test in the line function pointless so i'll take a look at it as soon as I get chance. If you have an example of how the line function is not working correctly I can take a look at it too.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Sun Sep 20, 2020 7:48 am

If you have an example of how the line function is not working correctly I can take a look at it too.
To see the problem try
  1.     Line (0, 0, 0, 0, 0, 0);
I realise of course that it is meaningless and a waste of time drawing a line to and from a single voxel but the problem arose in the context of a for loop where the parameters for the Line() function came from elsewhere in the sketch rather than being explicit as above. It is easy to work around once you know what is going on, but a nuisance

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Sun Sep 20, 2020 7:54 am

For completeness, here is the function where the problem arose
  1. void diagonalWipe(unsigned long speed)
  2. {
  3.   for (int c = 0; c < 8; c++)
  4.   {
  5.     for (int b = 0; b < 8; b++)
  6.     {
  7.       Line(c, b, 0, 0, b, c);
  8.     }
  9.     delay(speed);
  10.     for (int b = 0; b < 8; b++)
  11.     {
  12.       LineOff(c, b, 0, 0, b, c);
  13.     }
  14.   }
  15.   for (int c = 1; c < 8; c++)
  16.   {
  17.     for (int b = 0; b < 8; b++)
  18.     {
  19.       Line(c, b, 7, 7, b, c);
  20.     }
  21.     delay(speed);
  22.     for (int b = 0; b < 8; b++)
  23.     {
  24.       LineOff(c, b, 7, 7, b, c);
  25.     }
  26.   }
  27. }
As you will guess, the LineOff() function turns the line off and is a direct copy of the library Line() function with SetVoxel() replaced by ClearVoxel()

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube programming

Post by andrew » Tue Sep 22, 2020 1:46 pm

Thanks. I can see the problem and it should be a quick fix. I'll post an update tomorrow as soon as I get chance to check it works.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube programming

Post by BobBurton » Tue Sep 22, 2020 3:39 pm

There is no rush from my point of view. Currently I am just experimenting with different patterns to see how effective they are, hence the diagonal wipe

Post Reply

Return to “General Discussion”