Home Code Rainbowduino random led colors

Rainbowduino random led colors

by shedboy71
[lebox id="1"]

The Rainbowduino can be use to drive 8×8 RGB Led Matrices or a 4x4x4 RGB LED Cube in common Anode mode. Its a nice board for practicing some programming skills, in particular loops. The example below shows some randomised colors

Here is a picture of the shield fitted to an Arduino board and also there is an 8×8 matrix fitted to the shield, you usually buy these seperately

rainbowduino

rainbowduino

Code

Download the library from http://www.seeedstudio.com/wiki/images/4/43/Rainbowduino_for_Arduino1.0.zip

[cpp]

#include <Rainbowduino.h>
void setup()
{
Rb.init();
}

unsigned char x,y,z;

void loop()
{
//fill ever led in the matrix
for(x=0;x<8;x++)
{
for(y=0;y<8;y++)
{
//RANDOM COLOR
Rb.setPixelXY(x,y,random(0xFF),random(0xFF),random(0xFF)); //uses R, G and B bytes
}
}
//delay for 2 seconds
delay(2000);
}

[/cpp]

Links

2Pcs 8×8 Matrix RGB LED Common Anode Diffused Full Colour For Rainbowduino H1E1

Rainbowduino LED driver platform – Atmega 328

Share
[lebox id="2"]

You may also like