long cislo = 0;
void setup() {
DDRB |= 1<<5;
PORTB |= 1<<5;
delay(50);
PORTB &= ~(1<<5);
PORTB |= 1<<5;
delay(50);
PORTB &= ~(1<<5);
Serial.begin(9600);
Serial.println("zadajte cislo:");
}
void loop() {
while( ! Serial.available() );
cislo = Serial.parseInt();
for(int i=0; i<cislo; i++){
PORTB |= 1<<5;
delay(50);
PORTB &= ~(1<<5);
delay(50);
}
bufferCleaner();
}
void bufferCleaner()
{
delay(1);
while(Serial.available())
Serial.read();
}