Instructables

LED Cube 8x8x8

FeaturedContest Winner

Step 58: Software: Effect 2, plane boing

Picture of Software: Effect 2, plane boing
IMG_6175.JPG
IMG_6180.JPG
planboing_launcher2.png
effect_planboing2.png

Another simple effect, effect_planboing(int plane, int speed).

This effect draws a plane along the specified axis then moves it from position 0 to 7 on the axis and back again. This is very simple, but it really brings out the depth of the 3d LED cube :)

This function doesn't have an iteration loop. Instead it is called twice for each axis in launch_effect().

Here is what it does:

1) For()-loop i from 0 to 7.

2) Clear the cube with fill(0x00);

3) Call setplane() to draw a plane along the desired axis at position i. The plane isn't actually drawn on the axis specified, it is drawn on the other two axis. If you specify AXIS_Z, a plane is drawn on axis X and Y. It's just easier to think of it that way. Instead of having constants named PLANE_XY, PLANE_YZ etc.

4) Delay for a while.

5) Repeat the same loop with i going from 7 to 0.

Very simple, but a very cool effect!
 

 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!