int yellow = 11;
int white = 12;
int button = 13;
int buttonstate = 0;
void setup() {
// put your setup code here, to run once:
pinMode(yellow, OUTPUT);
pinMode(white, OUTPUT);
pinMode(button, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonstate = digitalRead(button);
if (buttonstate == 1)
{
digitalWrite(yellow, HIGH);
digitalWrite(white, HIGH);
delay(3000);
}
else if (buttonstate == 0)
{
digitalWrite(yellow, LOW);
digitalWrite(white, LOW);
}
}
//in the prevoius 2lesson lap, 5V pin do not have to connect to bread board, but this needs.