think somebody should develop a keyboard for programmers, that automatically lights your fingers on fire if you copy the same section of code more than once
Okay that's fine
But you won't havr said this if it was for a switch case statement you see this is what they are made for although what you say is correct and implicable but aattimes when you have to implement fast functions that work flawlessly you don't have the time to think about the for loops off course these cascades of if conditions can be later on converted into switch or for loop things but the time called for focusing on some other part of the system also these if conditions play no role in creation of the needed Animation
unsigned long prevValue , currValue, Addup = 16711680, this_led_color;
You just need to be considered with variables Addup(this 16711680 depicts 0xFF0000 in decimal form) and this_led_color is the variable that stores color that is to be loaded to the latest LED in the for loop.
Sorry for ignorance these must have been defined by me.
There would be a hell of a lot less typing, and calculating, if you calculated endTime - startTime ONCE.
I just typed one IF condition and then copied and pasted the other statements so that doesn't make any difference, although you are right.
Only you can see what it does.
Well you can see it too ,on the very first post I posted a YouTube video which shows the animation the function >>post_frame_moreLEDS_testing() is making YOU JUST NEED TO CONSIDER THIS FUNCTION AS THIS IS THE PLACE WHERE IT NEEDS CHANGES TO RUN THE ANIMATION THE OTHER SIDE.
Basically if you will see the video then you'll see that the snake trail animation is running from left to right only! I'm trying to also have it run from right to left!
In the video you can see the flow is going from left to right!
How it's happening is by adding to or deducting to the variable Addup, If the variable Addup is initially declared with 16711680 value(that is 0xFF0000 red full on) then deducting it by 65536 deducts 1 bit in the 0 to 255 byte range so basically i'm controlling the brightness(decreasing it) like this as such when the statement (Addup = Addup - 655360; )runs embedded under the for loop it deducts 10 x 65536 values for fast effect on the wave.
But the problem is that the wave flow effect I think must run from other side if I make the Addup variable = 0 and then add values in the forloop(in the statement Addup = Addup + 655360;) thus increasing the brightness but it shows the same effect?!!
I have this>> wave working in the single side but I want the same wave to flow the other way too! which until now I'm not able to accomplish actually it should be a matter of just decrementing the values of RED led brightness systematically and incrementing the brightness systematically in this line >> Addup = Addup - 655360; to achieve the desired effect but it isn't working right now, May be I'm wrong which is not a big deal it happens in programming. The Strip that I'm working is a WS2801 chip and it's available here >> https://www.sparkfun.com/products/11272
I'm dealing with the WS2801 chip this time and have these LED strips >> https://www.sparkfun.com/products/11272 , although I have worked with the WS2801 chip controlled strips but this time I'm wanting to create a Sine Wave effect on them, How to go about that according to you people?
myPort.write(float r + "," + float g + ";" + float b + ".");
You can simply load the parameters with int and you won't need any floats because you can use the Bytes to store the value at the receiving arduino end and the values can be from 0 to 255 (0 for LOW and 255 for FULL HIGH to a pin with in between numbers to dim and MIX colors) You can edit your processing code to sport 0-255 values inspite float values because using byte seems to be much more appropriate here.
You will need to get the data sent from the processing side sent within Packets , Data packets which will be sent to the Arduino serially, your current function will deal with it you have to read into a byte until you encounter COMMA and then read again also again till COMMA