Rainbow Cube Kit is a 3D RGB LED Cube useful for creating colorful design. The 3D Cube is artistically crafted with sixty-four 8mm RGB LEDs arranged in a 4 x 4 x 4 manner. Rainbow Cube Kit can be used to create many beautiful visual effects with A Rainbowduino. The Rainbow Cube Kit comes with an inbuilt 3.3V / 1 Amp LDO useful for powering the kit independently. A XBee compatible socket is provided as well, this can be used to connect Rainbowduino with a PC or an Arduino wirelessly.
This is sold in a Kit form. For a fully assembled kit see Rainbow Cube
Before starting to build your Cube, please read though all the instructions first. Building the Cube is not difficult, but it will take you about 90 minutes to finish
it.
To easily understand the working of Rainbow Cube kit, a very simplified schematic is presented below. In essence, 64 RGB LEDs are arranged in a form consisting of 8 common anodes(positive pins) and 8 common cathodes(gtound pins) for each color Red, Green and Blue.
The complete schematic of RGB Cube kit is represented in a 2D RGB LED Matrix form below.
Numbers 1 - 32 indicates the pin number of the 2x16 pin header shown above.
The RGB Cube kit inter-connection are presented in a block diagram format. This block diagram clearly shows how the 64 LEDs in 2D form are mapped into a 3D Cube form.
The X,Y coordinates of 2D RGB LED Matrix is mapped to the RGB Cube kit block diagram as follows:
Locate the 2D-XY coordinate (X,Y) from RGB Cube kit block diagram
Use these (X,Y) co-ordinates with (X,Y) coordiantes of RGB Matrix to know how the LED is controlled (i.e locating VCC and Cathode pins)
For example: LED (Z,X,Y):(1,0,3) ‘s 2D-XY is (6,3). This LED’s VCC is Pin 31. The R,G and B LED’s cathode are connected to 12,25 and 4 pins respectively.
To set a LED (Z,X,Y) we use setPixelZXY(Z,X,Y,R,G,B).
Usage:
Rb.setPixelZXY(unsigned char x, unsigned char y, unsigned char colorR, unsigned char colorG, unsigned char colorB); //This sets the pixel (z,x,y) by specifying each channel(color) with a 8bit number.
Alternatively a LED (Z,X,Y) can be set by using setPixelZXY(Z,X,Y,24bRGB).
Usage:
Rb.setPixelZXY(unsigned char z, unsigned char x, unsigned char y, uint32_t colorRGB /*24-bit RGB Color*/) //This sets the LED (z,x,y) by specifying a 24bit RGB color code
To understand the (Z,X,Y) pixel addressing let us see the another example. In this demo, the Layer 0 (i.e Z-0) is painted Green and Layer 3 is painted Blue.
/*
Rainbowduino v3.0 Library examples: Cube2
Sets pixels on 3D plane (4x4x4 cube)
*/
#include <Rainbowduino.h>
void setup()
{
Rb.init(); //initialize Rainbowduino driver
}
unsigned int z,x,y;
void loop()
{
for(x=0;x<4;x++)
{
for(y=0;y<4;y++)
{
//Paint layer 0 Green
Rb.setPixelZXY(0,x,y,0x00FF00); //uses 24bit RGB color Code
}
}
for(x=0;x<4;x++)
{
for(y=0;y<4;y++)
{
//Paint layer 3 Blue
Rb.setPixelZXY(3,x,y,0x0000FF); //uses 24bit RGB color Code
}
}
}
Output
Cube2.pde Demo
In this demo, all LEDs are painted with some random color. After five seconds of delay, the whole cube is repainted with random colors.
/*
Rainbowduino v3.0 Library examples: Cube3
Sets pixels on 3D plane (4x4x4 cube)
/*
Rainbowduino v3.0 Library examples: Cube3
Sets pixels on 3D plane (4x4x4 cube)
*/
#include <Rainbowduino.h>
void setup()
{
Rb.init(); //initialize Rainbowduino driver
}
unsigned int z,x,y;
void loop()
{
for(z=0;z<4;z++)
{
for(x=0;x<4;x++)
{
for(y=0;y<4;y++)
{
//Paint random colors
Rb.setPixelZXY(z,x,y,random(0xFF),random(0xFF),random(0xFF)); //uses R, G and B color bytes
}
}
}
delay(5000);
Rb.blankDisplay(); //Clear the LEDs (make all blank)
}
Welcome to the new documentation system of Seeed Studio. We have made a lot of progress comparing to the old wiki system and will continue to improve it to make it more user friendly and helpful. The improvement can't be done without your kindly feedback. If you have any suggestions or findings, you are most welcome to submit the amended version as our contributor via Github or give us suggestions in the survey below, it would be more appreciated if you could leave your email so that we can reply to you. Happy Hacking!