I have a sketch that lights 5 LED boards with port expanders. Stand-alone, the program works as intended, lighting up all the LEDS, in sequence, like a chaser, on the perimeter of my star shape.
As I have done with other sketches, I run them stand-alone, then copy and paste the relevant code into a larger sketch as a function, where I will run all functions in some kind of sequence.
To make sure it works, after I do the cut and paste, I uncomment only the function under test so only it runs. Well it doesn’t run. Other sketches-turned-to-functions DO WORK, but this particular one does not.
I’ve attached the MAIN sketch with the function locate at line 329. It is called “PointsCCWrot”, the same as the sketch name, also attached.
I’ve checked all the setup parameters and they are okay, maybe a little confusion with declaring variables, but changing these latter items don’t fix the problem.
Strange too is that only device 24 lights up and if I comment this out so that program has to run device 23 or any other, STILL 24 lights up.
I can’t see having timing problems or memory problems. I’m only running the one function, the same as the one sketch (pointsCCWrot).
PointsCCWrot.ino (1.8 KB)
MAIN.ino (12 KB)