void setup()
{
pinMode(4, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(14, OUTPUT);
pinMode(14, OUTPUT);
pinMode(5, INPUT);
}
void loop()
{
digitalWrite(4, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
delay(2000);
digitalWrite(14, HIGH);
delay(2000);
digitalWrite(14, LOW);
delay(2000);
digitalWrite(4, HIGH);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
delay(2000);
digitalWrite(4, LOW);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
delay(2000);
if(digitalRead(5)==HIGH)
{
digitalWrite(14, HIGH);
}
else
{
digitalWrite(14, LOW);
}
}

 
Loading
st-nucleo-c031c6