So after a short revision of the existing code i added two new functions just for fun.
You can find them here:
https://gist.github.com/Stefan-Xp/e0cd595200d31ee6518c (Forked from DaveDarko)
I would love to get some feedback ;)
Next: Create some nice animations :D With a 3x3x3 Cube how many different "frames" could be created before repeating? ;)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
A cool add-on would be integer arrays instead of boolean arrays, to integrate fading into animations.
Are you sure? yes | no
Does it fade to fast or to slow?
What do you mean by "fade between values"?
That would indeed be cool ^^
Are you sure? yes | no
I meant something like fade_between(64,127) and it only fades between 64 and 127 up and down, but I guess that's what you've build. Not sure why it wont work on my board. Atmega8 fail? Looks like the same way my code works... strange.
Are you sure? yes | no
Try a bigger Steps Value?
Its a bit strange...
BTW... did you see this remark: "A boolean holds one of two values, true or false. (Each boolean variable occupies one byte of memory.)" ? So we could also use Byte instead for animations, which would give up to 254 Brightness Levels.
Are you sure? yes | no
Never noticed that it takes a byte, too. Thought the compiler would do some magic with bits in eight bytes. Well then, why not, lets use byte :D
Are you sure? yes | no
Are you sure? yes | no
But In my case I'm using npn transistors to drive the layers - so the layer is active when High.
Are you sure? yes | no
Btw: I just updated the SW.
Are you sure? yes | no
Are you sure? yes | no
I changed it a bit to;
byte mode=1;
void loop() {
//// select one
//mode = random(8);
//mode = 1;
mode++;
Are you sure? yes | no
I calculated 168mA per Layer as worst case.
Are you sure? yes | no
Are you sure? yes | no
BTW: http://subethasoftware.com/2013/04/09/arduino-compiler-problem-with-ifdefs-solved/ => Now it works how its supposed.
Perhapps the Cathode High and Low definitions can also go into those #ifdef statements.
And i shrinked the programm from 5.242 Byte to 5130 by replacing the integer Pins with defines.
Are you sure? yes | no
I don't have any problems switching those values :)
Are you sure? yes | no
But I think there are some issues with the count of frames...
Feel free to test it ;)
Are you sure? yes | no