Hallo, in my code the int A is not declaired and I don't understand why.
I would like to pass A without problem into a for loop nested within an if.
code:
int A = SOME_DEFINED_NUM % OTHER_NUM;
int k = VALUE;
void foo(int A) {
if (A != 0) {
for (int i = 0; i < A; i++) {
color[i].val = 255 * abs(sin( (i * PI / OTHER_NUM))); //this line works, color is a CHSV
ledHSV[(SOME_DEFINED_NUM - A - 1) + i] = color[k]; //this line is the problem. A is not declaired here
}
}
- Why is A not declaired? is there a way to make it declaired?
- Is it the for loop or the if loop?
Thank you very much