WonderTiger:
Well I hope you will finish it sometime soon, I'm quite interested in seeing that thing flash!
Me too Crossroads. We are expecting big things here
Mike - I am still keen to make my 5 x5 x5 cube and try your code in it. I am just waiting for my parts to arrive and I will be in contact with some feedback and knowing me also a few questions
Your Eagle board is too large for me to use in the free version of Eagle so when my parts arrive, which should be very soon I will probably just design a smaller driver PCB and hard wire that to a piece of veroboard that has the cube structure attached. I am keen to make this and try your software and especially the GUI.
Should be good
Did you post this at Reddit Arduino you might generate more interest over there. If you do or have can you please let me know
Yes indeed, the free version of Eagle is limited to a 10 x 10 cm PCB. I think that is too small for the 5x5x5 PCB with through hole components. Maybe SMD would do the trick :P. In my old topic I also made a protoboarded PCB for my 5x5x5 one, was pretty easy to do and got no problems with it whatsoever. I even protoboarded my 8x8x8 at first, that was a pain in the *** to do, all those wires :o.
That GUI what you're talking about is just to change the gamma value, nothing fancy :P. This is the code it generates
/*
gammaCorrection.h - Library for converting the linear brightness to a gamma
corrected brightness. This library may be generated by the gamma correction table
generator.
Copyright (C) 2015 Mike Neuhaus.
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef gammaCorrection_h
#define gammaCorrection_h
#include<inttypes.h>
#include<avr/pgmspace.h>
// Macros
#define MAXIMUM_BRIGHTNESS sizeof(gammaCorrectionTable) / sizeof(uint8_t)
#define gammaCorrectedBrightness(x) (x < MAXIMUM_BRIGHTNESS ? pgm_read_byte_near(&gammaCorrectionTable[x]) : x)
/*
!!!!!!!This comment is used for the gamma correction table generator, DO NOT REMOVE OR MODIFY!!!!!!!
GAMMA_CORRECTION_VAL = 1,65
*/
const uint8_t gammaCorrectionTable[] PROGMEM =
{
0,
0,
1,
1,
2,
2,
3,
4,
5,
6,
8,
9,
10,
12,
13,
15
};
#endif
And then it changes the gammaCorrectionTable according to the chosen gamma value.
I've also post it on reddit, click here. Got 0.0 reactions there, haha. Maybe because I didn't wrote it all in details like I did here, but I had no choice as I was limited on characters :P.
Thanks Mike I go my parts today but I think that the Ebay LED's I got have the short leads that may not be suitable as they will restrict how far the LED's can be apart. Oh the joys of buying "cheap" parts from China I will have a look at my options later and let you know but one thing for sure I will build this and use your software you can count on that . Have a good weekend and don't study too hard
Haha, I will certainly hear it when you finish your cube with the right LEDs. You too have a good weekend (although that is probably a little bit late :P).
About the library, I just ordered a Bluetooth transceiver module. With that I want to make the library communicate to a pc/android device. So in the next few weeks I'll try to support Bluetooth communication. It could take longer as my study will start again next week, I'll keep you guys posted!
First of all, thank you for all that work, very useful to me.
I am willing to make a 3d connect4 game with leds, so i'd need 2 different colors interlocked 4x4x4 leds cube.
I was planning on making a non-cubic led matrix (i.e. 16 columns x 8 layers with the top 4 layers in a different color),but i can't really figure out how to modify your library.
Do you think it's possible?
Do you(or anyone) have any idea?
Also i'd like to put some sound to it with a MP3 shield, but it also uses SPI interface.
So i'd need to use the slave select.
Do you think it's possible?
First of all, thank you for all that work, very useful to me.
I am willing to make a 3d connect4 game with leds, so i'd need 2 different colors interlocked 4x4x4 leds cube.
I was planning on making a non-cubic led matrix (i.e. 16 columns x 8 layers with the top 4 layers in a different color),but i can't really figure out how to modify your library.
Do you think it's possible?
Do you(or anyone) have any idea?
Also i'd like to put some sound to it with a MP3 shield, but it also uses SPI interface.
So i'd need to use the slave select.
Do you think it's possible?
Hi Quentin,
Thanks for the kind words!
About the BI-COLOR LED cube (even RGB), it shouldn't be too hard to modify my library to get it working. What you could do is build two LED driving circuits that each have 2 shift registers (for a 4x4x4 LED cube). Each circuit drives a color, then these two circuits can be cascaded (just like you cascade the two SR from a single circuit). Then you only have to add another frame buffer to store the data of each color (actually consist of two buffers....), change the voxel calling functions and add another for-loop to send out the bytes from the added frame buffer. If you are really going to build a two colored LED cube, I'd love to help and modify my library to get it working.
About the mp3 shield, I'm not sure if its possible to integrate that. It depends if you need the SPI bus to be available at any time. This is due my interrupt routine relies on the SPI bus to refresh the cube. If this isn't the case then it should be able to integrate it. Soon I'm going to look if I can interface my library with an SD card reader (which also works on the SPI bus), so I will let you know about that.
Some general information. Currently I'm able to select animations and change brightness according to serial input (either USB or BT). I've recently got my serial communication protocol finished (based on the HDLC protocol), so soon I'm able to start making an android app to be able to select animations via BT. Once this is all done I will release it as V3.0 and am going to make another tutorial on how to create animations, as this is changed as well because the delays in the current animations couldn't be used with serial communication...
It's been quite a time ago since the last update, I have been busy with school lately, however I successfully interfaced my LED cube with my android device last week. This weekend or the beginning of next week I will release V4.0 of my library. This version will include some API for the android platform.
@Pedro, I'm curious did you build your 5x5x5 cube already :D?
I'm not quite ready yet, however here is the first part of V4.0 of the library.
The major changes in this version is the way the animation are created. Previously all the animations were defined in a single separate animation file. All these animation had one major flaw, that was the blocking operation of each animation function. Because the animation blocked the main loop during the execution of the animation, I wasn't able to do anything besides execution of that particular animation function. This prevented me to do any communication with the serial bus (android) of the arduino.
Right now every animation is placed inside a separate header and source file, this means every animation has its own class. I will not explain in detail how an animation is created nor how its working. The only important thing to know is that the updating part of the LED cube is now done only when required. Its exactly the same as blinking a LED without delay. There is one example available from the sketchbook. Examine it carefully and try to convert your animations to a separate header and source file. I've also included a standard lay-out to create your own animations.
In V4.0 I've also added an animation player (generator). It works somewhat the same as your conventional MP3 player. You have an playlist that has all the animations (with their custom parameters) defined. This playlist is then fed to the animation generator. With the generator you can set the following properties:
Repeat (true/false)
Shuffle (true/false)
Animation time (0...65535ms)
Besides these options you can also go to the next or previously played animation. An example is added to the example sketchbook, see 'Using_predefined_animations.ino'.
Because some delays I did not yet include any android communication. I have it working on my cube however the code written for Android is not quite finished yet. To give you an impression down below is a picture of one of my Android test apps. In the official version I will also add an option to choose animations from a list.