Remember I was busy working with interrupts, next step is to use them in a sensible way. To simplify the software I’m using interrupts for switching to the next frame.
Led cubes display multiple patterns in a sequence. Just like a movie a Cube is made up out of frames, every frame representing an image. Luckily my cube only has patterns of 5×5x5×3 pixels, which requires less storage. But there’s a catch: only one LED can be switched simultaneously inside a matrix.
The software setup will look like this:
void patternView(int *f)
{
int i = 0;
int j = 0;
for(;;)
{
i = *f;
if(i > 3)
*f = 0;
for(j = 0; j<4; j++)
{
set('a'+i, j);
Delay1KTCYx(10);
}
}
}
The pointer will be incremented by the ISR.
Result movie:
