Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void setup() {
// put your setup code here, to run once:
pinMode(8,OUTPUT); //DIODA 1
pinMode(9,OUTPUT); //DIODA 2
pinMode(10,OUTPUT); // DIODA 3
pinMode(11,OUTPUT); // DIODA 4
pinMode(12,OUTPUT); // BUZZER
pinMode(13,INPUT); // input dla przycisku
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(13) == HIGH)
{
delay(1000);
digitalWrite(8, HIGH);
digitalWrite(12, HIGH);
delay(400);
digitalWrite(12, LOW); //pierwszy sygnal
delay(500);
digitalWrite(9, HIGH);
digitalWrite(12, HIGH);
delay(400);
digitalWrite(12,LOW); //drugi sygnal
delay(500);
digitalWrite(10, HIGH);
digitalWrite(12, HIGH);
delay(400);
digitalWrite(12, LOW); //trzeci sygnal
delay(500);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
delay(1200);
digitalWrite(12, LOW); //czwarty sygnal
}
else
{
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.