Using serial monitor

I want to write a number such as 100 in the serial monitor of redoing my function without writing my code 100 times, is it possible ? Thanks.

Is it possible? Probably. Is what possible? Well, I am not sure because I don't understand the question.

Please try again.

I want to make a loop from serial monitor for a certain times, such as 100 times without writing my code 100 times .
Can I do it ?
Thanks

Something like this - using for() construct to print (for) loop count 100 times?

for( initialize count to 0 ; check count != 100; advance count ) Serial print ( current count is )

for example if I want to make certain number of loops using serial monitor for this simple code ... How to make it ? Thanks.

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

Below is an example of an incrementing loop from the IDE example code.

for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(115200);    // setup / initialize serial AKA monitor 
}

void loop() {

for(int i = 0; i !=100;i++)
{
//  will flash LED 13 on / off  ( 1 second) 100 times 
//  and print the current number of cycle 
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
  Serial.printl" Cycle number ");
  Serial.println(i); 
}
}

Another of Vaclav's "find my not-really-deliberate mistake or pseudocode" posts. 8)

If you're going to post code, please state clearly that it is uncompiled and therefore untested.

Um, do you want to do something 100 times in loop() and then stop?

void setup() {}

int loopTimes = 0;
void loop() {
  if (loopTimes < 100)
  {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000);
    ++loopTimes;
  }
}

AWOL: Another of Vaclav's "find my not-really-deliberate mistake or pseudocode" posts. 8)

at least he used some code tags... this time

BulldogLowell: at least he used some code tags... this time

True. +1 karma to Vaclav.

Thank you all guys .... I wrote this code but I have an error

'class HardwareSerial' has no member named 'printl'

void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(115200);    // setup / initialize serial AKA monitor
}

void loop() {

for(int i = 0; i !=100;i++)
{
//  will flash LED 13 on / off  ( 1 second) 100 times
//  and print the current number of cycle
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
  Serial.printl" Cycle number ");
  Serial.println(i);
}
}

'class HardwareSerial' has no member named 'printl'

The error is very precise.

Serial.printl" Cycle number ");Did you mean Serial.print() or Serial.println() ?

Spelling counts. So do parentheses.

I just copied the error

sketch_jan20a:17: error: 'class HardwareSerial' has no member named 'printl'

   Serial.printl " Cycle number " ) ;

          ^

sketch_jan20a:17: error: expected ';' before string constant

   Serial.printl " Cycle number " ) ;

                 ^

exit status 1
'class HardwareSerial' has no member named 'printl'

let him who is without sin cast the first stone

To all you petty geeks who never made a mistake - the compiler found my typo , hsalame asked for help and you have a heyday crucifying me.

Thanks

you have a heyday crucifying me.

Hardly. I didn't even realise that it was your mistake, and I was very gentle with my suggestion as to the problem.

I did it thanks

Vaclav: let him who is without sin cast the first stone

To all you petty geeks who never made a mistake - the compiler found my typo , hsalame asked for help and you have a heyday crucifying me.

The mistake was pointed-out, you had the opportunity to fix it (or make it clear that you hadn't compiled or tested the code), but you didn't.

what is wrong with this code , it’s not working !!

int value;
void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(115200);    // setup / initialize serial AKA monitor
}

void loop() {
value = Serial.read ();
if (value == 1)
{
for(int i = 0; i !=100;i++)
{
//  will flash LED 13 on / off  ( 1 second) 100 times
//  and print the current number of cycle
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  Serial.print ( " Cycle number " ) ;
  Serial.println(i);
}
}
}