subject

This is what I currently have, im just not sure about how I should go about making the lights blink since I only have 1 pushbutton int ledPinSingle= 9;
int ledPinFlash1= 10;
int ledPinFlash2= 11;
int ButtonPin =2;

void setup(){
pinMode(ledPinSingle, OUTPUT);
pinMode(ledPinFlash1, OUTPUT);
pinMode(ledPinFlash1, OUTPUT);
pinMode(ButtonPin, INPUT);
Serial. begin(9600);

}

void loop(){
if(digitalRead(ButtonPin)==HIGH)
{
digitalWrite(ledPinSingle, HIGH);
Serial. print("Single LED on");
}
else if (digitalRead(ButtonPin) == LOW){
digitalWrite(ledPinSingle, LOW);
digitalWrite(ledPinFlash1,HIGH);
digitalWrite(ledPinFlash2,LOW);
Serial. print("Flashing back and forth");
delay(50);

}

}


This is what I currently have, im just not sure about how I should go about making the lights blink

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
You draw two cards from a standard deck of 52 cards, but before you draw the second card, you put the first one back and reshuffle the deck. (a) are the outcomes on the two cards independent? why?
Answers: 3
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
You know the right answer?
This is what I currently have, im just not sure about how I should go about making the lights blink...
Questions
question
Biology, 20.04.2020 02:21