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 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
The gene form of a trait is called a(n) 
Answers: 2
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): ‘what is your name? ’ “josh” ‘, josh. what is your favorite color? ’ “green” ‘mine too. do you also like ice cream? ’ “no” ‘josh, how old are you? ’ “40” ‘ and how many siblings do you have? ’’ “3” ‘that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
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
Computers and Technology, 03.02.2022 17:00
question
Mathematics, 03.02.2022 17:00
question
Physics, 03.02.2022 17:00
Questions on the website: 13722361