Sooooo… this is question is probably borderline insulting, but I am trying to make a simple pulsating light, pretty simple thing but for the life of me I cant figure out how to “slow down” a quadwave8 function to drive the setBrightness function. In a normal sine wave I would just divide x by whatever value I want so it decreases the frequency of the wave. But if I try that using de quadwave8, it just makes a weird Jigsaw style wave.
does anybody have a suggestion on how I can do this? I have tried everything I can think of with no good result.
You might take a look at beatsin8, you can control how many times per minute it cycles. I’ve made a beatcos8 companion method, you should be able to look at the source and make a ‘beatquad8’ one: https://github.com/pixelmatix/aurora/blob/Aurora1.5/Effects.h
wohoo!!! the beatsin8 function worked like a charm and exactly what I needed, thanks Jason! I didnt get to try your option Marc since the beatsin8 makes for a one line piece of code that does what I nedded, thank you very much though, it is really apreciated.
Now Jason… where can I find all this extra functions that I have seen in other peoples pieces of code, like beatsin8, since it doesnt appear to be documented, or at least I couldnt find it :s I have seen others like :
set_max_power_in_volts_and_milliamps(5, 500);
delay_at_max_brightness_for_power();
these are from the Demo pack that Andrew Tuline put together (awsome set of examples by the way) but I cant find those functions anywhere.
Thank you very much guys, I did find the references, I had read through the wiki a whole bunch of times but I guess I wasnt really sure I understood what I was looking at… My programming experiences is not exactly where I would like it to be or fully at par with my ideas but thanks for the help, it is very useful!