Hello to everyone i have some problem with my last arduino sketch.
In a few words in the main loop of my program i have to invoke a function and inside this function i should use another loop.
Is this possible??
Can I use something like a loop?
for (i=0; i < 10 ; i++){
Serial.println(i);
delay(100); // a delay here so it doesn't zoom by so fast in the monitor
}
This loop would start i at 0, then ++ add one until it violates the middle condition, so it will count up to nine.
You can put another for loop inside of that to do something else. Kind of like the movie Inception.
Where's the return type? Why are you defining another function whose name differs from a reserved name in case only?
Serial.println(answer);
Some value appears on the serial monitor. What does it mean? Adding another Serial.print() statement with some descriptive text, to be printed in front of the value is generally a good idea.
answer = f(i);
Where's the f function?
int sum(int j)
This function isn't called anywhere. Why include it?