Step 66PC 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 Step | Download PDFView All Steps | Next Step » |





























































































![Hard Wired LED Cube: [No Programming]](http://img.instructables.com/files/deriv/FTD/SF1T/GO8DC8KW/FTDSF1TGO8DC8KW.SQUARE.jpg)















could you please send me the hex file of this effect ?
I'm not good at math
But now I can not compile the hex file.
i have only the c files
It ain't that hard to figure out.
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.
Here is the file again.
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