const int ledPin = LED_BUILTIN; int rep; void setup() { Serial.begin(9600); Serial.println("Setup initiated"); pinMode(ledPin, OUTPUT); Serial.println("Setup terminated"); } void loop() { if (Serial.available() > 0){ rep = Serial.read() - 48; for (short i = 0; i < rep; i++) { Serial.println(rep); digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } } }