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 66PC Software: Effect 1, ripples

PC Software: Effect 1, ripples

This is the first effect we made for the PC software, and we think it turned out very nice.

While this may seem like a complicated effect, it's really not!

All the effect functions running on the micro controller mostly use if() statements to create effects. The effects on the PC software are built a little different. We use a lot of sin(), cos() and other math functions here. Most coordinates are calculated as floating point coordinates then typecast into integers before being drawn on the cube.

The effect you see in the video is actually just a sine wave eminating from the center of the cube, x=3.5, y=3.5.

Here is how it works:

1) Loop through the iteration counter.

2) Loop through all 64 x and y coordinates.

3) Calculate the distance between the center of the cube and the x/y coordinate.

4) The z coordinate is calculated with sin() based on the distance from the center + the iteration counter. The result is that the sine wave moves out from the center as the iteration counter increases.

Look how easy that was!
 

« Previous StepDownload PDFView All StepsNext Step »
6 comments
Apr 30, 2012. 1:48 AMjenkycents says:
good work ;)
could you please send me the hex file of this effect ?
I'm not good at math
Apr 30, 2012. 3:03 AMjwestenberg says:
You can download the hex files from step 48 and 64.
Apr 30, 2012. 4:16 AMjenkycents says:
ok i found the effects thanks .

But now I can not compile the hex file.

i have only the c files
May 1, 2012. 12:05 AMjwestenberg says:
You have to download winavr. After you have downloaded and installed you can open and compile the files in the programmers notepad.

It ain't that hard to figure out.
May 1, 2012. 3:50 AMjenkycents says:
how can I do to make the effects of the "PC Software" without a PC?
May 1, 2012. 4:41 AMjwestenberg says:
You can't
May 1, 2012. 5:11 AMjenkycents says:
so how i can execute the software ?
May 1, 2012. 6:25 AMjwestenberg says:
You can only do this on a linux operating system since no one ever got this working in Windows.
So you need to unpack the file open the folder in terminal window and type "make" .
This makes an executable file for linux.
After that you have to type ' sudo ./cube' to execute the file you just made.
May 1, 2012. 9:16 AMjenkycents says:
ok thanks ;)
Apr 30, 2012. 3:37 AMjenkycents says:
i'm looking for the wave , the ripples and the fire works effect hex . i dont found it :(
May 7, 2012. 6:29 AMristdaro says:
Compile the following attached file, Thanks to triumphtotty for the code. It gives you all the waves and ripple effects running directly from the ATMEGA32

May 7, 2012. 6:30 AMristdaro says:
Sorry didn't work the fist attempt

Here is the file again.
May 7, 2012. 5:23 PMjenkycents says:
works perfectly and has other effects! o.o
May 7, 2012. 12:15 PMristdaro says:
Triumphtotty posted the code a while back. If you read through the earlier messages he explains how you can amend the code to create your own variations. You will probably want to change the text from my initials "RR" to your own for instance.
Open Launch_effect.c in programmers notepad and amend case 20. You will see "RR and "LED CUBE"

If you read Triumphs messages he explains how to change some of the more interesting effects.

Have fun
May 7, 2012. 4:38 PMjenkycents says:
thanks so much ;)
Apr 30, 2012. 2:10 AMjenkycents says:
the effect 1,2,3 and 4 . thanks
Feb 16, 2011. 9:07 AMfebinjohn says:
cooooooooooooooooollllllllllllllllll

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