Dear guys / gals
I have read the forums but not sure / dont know how to approach the problem
This is how the code looks
Help me conclude so I can finish and close the loop
Thank you
void setup() {
lc.shutdown(0,false);
lc.setIntensity(0,5);
lc.clearDisplay(0);
}
void loop() {
for (int i = 0; i<8; i++) lc.setRow(0,i,sf[i]); // Display sad face
delay(1000);
for (int i = 0; i<8; i++) lc.setRow(0,i,pn4[i]); // Display 4
delay(1000);
for (int i = 0; i<8; i++) lc.setRow(0,i,pn3[i]); // Display 3
delay(1000);
}
And the problem is. . . ?
(You didn't post all your code?)
Paul_B
July 6, 2022, 10:44pm
3
Point of terminology.
Please note there is no such thing as a "void loop()". There is a function which is called "loop()". As a matter of definition it returns no parameter when called so it is first defined as " void". But you always refer to it as " loop()".
1 Like
Geez, my software looks like that!
1 Like
Looking in othr forums I found this solution
After the last delay(1000) I added the text below and the loop stoed
delay(1000);
// Exit the loop
exit(0); //The 0 is required to prevent compile error.
}
b707
July 6, 2022, 11:39pm
7
It is not a 'solution", it's wrong.
Why do you want "to close a loop"? What for?
If you want that your code is run only once - move it to setup().
Alternatively, use for(;;); or while(1); at the end of loop() . Or use a flag (variable) for stuff that you only want to run once.
good idea So I would just leave it under setup ?
Paul_B
July 7, 2022, 2:39pm
10
That is teh idea.
Something you want to only ever do once , you put in setup().
Things you want to continue to do, go in loop().
It is rather unusual that you want to use a microcontroller to do one thing and no more.
system
Closed
January 3, 2023, 2:40pm
11
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.