Charliecube problem

I loved the description of Asher Glick's Charlie Cube.

So I decided to create my own.
But somehow I must have mixed up something because the cube's levels seem to be offset by 1 height.
This isn't noticeable during most animations but still annoys me.

So drawLed(red, 0, 0, 0) turns on the top LED for first row and columun.
drawLed(red, 0, 0, 1) turns on the bottommost LED for first low and column.

z= 0 is top(4th)
z= 1 is bottom(1st)
z = 2 is 2nd from bottom
z = 3 is 3rd from bottom

I was pretty sure that I could just update some setting in the mappings.h.
And I tried to change it but no luck. I didn't even see a change in the behavior of the cube...

Not sure how many of you also did the charliecube and if yes you ran into a similar issue but any help would be appreciated!

The height being off is due to the connections between the arduino, and cube being 90 degrees off. I have a few charliecubes, and I've done a lot of documentation and testing.

I looked at the map file, but I never modified it. It seems to me that there are 4 possible ways to connect to the cube, and 4 different maps would solve the problem of having the cube turned the wrong way when wiring it to the arduino.

There is also another ay to solve the problem, but its even more difficult (rotate each spire 90 degrees.)

I dont know the ports or how any of that works, but it looks like the beginning of the file has 16 groups of 3 lines like this:

#define P1B 0x00
#define P1C 0x00
#define P1D 0x04

My guess is that changing these will do what you want, but I havnt done it, and I havnt messed with any ports stuff.

Heres my charliecube documentation:

Looking over the wiring, I can see that changing the mapping wont do what you want.

I did try a few different mappings, and got changes, but not the way I wanted.

Changing the z value seem like a better way to modify it, but im not sure where or how.

There is something called FLUSH BUFFER, and it looks like a mapping for each LED. That might be a good place to make some changes.

In the cubeplex.h, change your code to this:
Under :
/******************************** FLUSH BUFFER ********************************
You will find this mapping table that looks something like this:

  //TODO the pins values need to be changed so that the mapping.h file can
  // change them using #defines
  if (_cube_buffer[ 0] != 0)flushElement(copy_frame, 4, 8,_cube_buffer[ 0]);
  if (_cube_buffer[ 1] != 0)flushElement(copy_frame,16, 4,_cube_buffer[ 1]);
  if (_cube_buffer[ 2] != 0)flushElement(copy_frame,12,16,_cube_buffer[ 2]);
  if (_cube_buffer[ 3] != 0)flushElement(copy_frame, 8,12,_cube_buffer[ 3]);
  if (_cube_buffer[ 4] != 0)flushElement(copy_frame, 4, 7,_cube_buffer[ 4]);
  if (_cube_buffer[ 5] != 0)flushElement(copy_frame,13, 4,_cube_buffer[ 5]);
  if (_cube_buffer[ 6] != 0)flushElement(copy_frame,11,13,_cube_buffer[ 6]);
  if (_cube_buffer[ 7] != 0)flushElement(copy_frame, 7,11,_cube_buffer[ 7]);
  if (_cube_buffer[ 8] != 0)flushElement(copy_frame, 4, 6,_cube_buffer[ 8]);
  if (_cube_buffer[ 9] != 0)flushElement(copy_frame,15, 4,_cube_buffer[ 9]);

Note: above is just a little bit of the table, the whole thing is 192 lines, and wont fit in one message.

I attached a copy of just the table in a text file. Copy the contents, and paste it in place of the original table.

It will either change it the right direction, or the wrong direction, and the wrong direction might not be obvious right away.

If you go into charlieCube.ino you can comment out the programs you dont want to run. for now, comment out all but shiftsquares.

void loop() {
//  planarSpin();
//  fountian();
//  trifade();
//  tunnel();
//  chaseTheDot();
//  planarFlop3D();

Then upload it and see if the squares move around correctly. If it looks good, go back and uncomment out those lines charlieCube.ino.

FlushBufferShift1.txt (14.2 KB)

I’ve modified the original cubeplex.h file. It now includes 4 maps for the 4 ways that are easy to miswire the cube. Assuming you aligned all the spires, and the only problem is that you didnt have the cube in correct orientation when wiring the circuitry to the cube. You still have a 25% chance of getting it right, but if you didnt, Scroll to Flush Buffer, and comment out and uncomment different sections of code, till your cube works right.

When checking the cube to see if it looks right, use just the shift-squares program (comment out like mentioned in the previous post), if the cube looks ok, then comment shift-squares out, and uncomment fountain. If it looks weird, you are probably off by 2 sides and should try the map for 2 sides off. Then try fountain and see if it looks right. (it starts in the bottom center, goes to the top, then down the outside.) When it looks right, you have it set right.

cubeplex.h (76.1 KB)

wow Hippynerd!
Thanks for all your work, I owe you one!

Youre welcome. Let me know if you do anything interesting with it.

I also make one of the Asher Glick RGB cube. When I apply drawLED(yellow,0,0,0), the cube show me that 1 LED with green and 1 LED with blue color instead of a single yellow LED. Anyone can solve this?