3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LED Cube 8x8x8

Step 57Software: Effect 1, rain

Software: Effect 1, rain
Lets start with one of the simplest effects.

In effect.c you will find the function effect_rain(int iterations).

This effect adds raindrops to the top layer of the cube, then lets them fall down to the bottom layer.

Most of the effects have a main for() loop that loops from i=0 to i < iterations.
effect_rain(int iterations) only takes one argument, which is the number of iterations.

Inside the iteration loop, the function does the following:

1) Create a random number between 0 and 3, lets call it n here.

2) Loop a for() loop n number of times.

3) For each iteration of this loop, place a pixel on layer 7 (z=7) at random x and y coordinates.

4) Delay for a while

5) Shift the contents of the entire cube along the Z axis by -1 positions. This shifts everything down one level.

This is a pretty simple effect, but it works!



« Previous StepDownload PDFView All StepsNext Step »
2 comments
Mar 25, 2011. 7:11 AMung says:
very cool !
Jan 3, 2011. 5:49 PMancienthart says:
This could be altered to make a "matrix" effect. :)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
651
Followers
7
Author:chr
I like microcontrollers and LEDs :D