1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solmaris [256]
3 years ago
15

Write a program to control the operation of the RED/GREEN/BLUE LED (LED2) as follows: 1. If no button is pressed, the LED should

remain OFF. 2. When only Button 1 is pressed, the BLUE LED should blink ON and OFF with a 1 second period. The RED and GREEN LEDs should remain OFF. 3. When only Button 2 is pressed, the RED LED should blink ON and OFF with a 4 second period. The GREEN and BLUE LEDs should remain OFF. 4. When both Buttons are pressed, the GREEN LED should blink ON and OFF with a 2 second period. The RED and BLUE LEDs should remain OFF. 5. At no time should two LEDs be on. The states of the Buttons and LEDs are described in Ta
Engineering
1 answer:
aalyn [17]3 years ago
4 0

Answer:

See explaination

Explanation:

int RED=10; int BLUE=11; int GREEN=12; int BUTTON1=8; int BUTTON2=9; void setup() { pinMode(RED, OUTPUT); pinMode(BLUE, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BUTTON1, INPUT); pinMode(BUTTON2, OUTPUT); } void loop() { int BTN1_STATE=digitalRead(BUTTON1); int BTN2_STATE=digitalRead(BUTTON2); if(BTN1_STATE==HIGH) { digitalWrite(BLUE, HIGH); delay(1000); // Wait for 1 second digitalWrite(BLUE, LOW); } if(BTN2_STATE==HIGH) { digitalWrite(RED, HIGH); delay(4000); // Wait for 4 seconds digitalWrite(RED, LOW); } if(BTN1_STATE==HIGH && BTN2_STATE==HIGH) { digitalWrite(GREEN, HIGH); delay(2000); // Wait for 2 second digitalWrite(GREEN, LOW); } }

You might be interested in
Which of the following best describes the role of engineers
Fantom [35]

Problem Solvers

Explanation:

Engineers find problems in the world, and then they find solutions for them.

8 0
3 years ago
(True/False) Unix is written in the C language. *<br> True<br> O False
Katarina [22]

Answer:

false

Explanation:

8 0
2 years ago
Read 2 more answers
What is the name of the first federation vessel in star trek hint 17?
Nitella [24]

Answer:

The Fesarius

Explanation:

It's the first vessel

7 0
2 years ago
Find the velocity and acceleration of box B when point A moves vertically 1 m/s and it is 5 m
Goshia [24]

Answer:

hshbdhehdjsbdjdissasoe

7 0
3 years ago
Bryan a project manager and his team have been assigned a new project. The team members have already started working on their as
Vedmedyk [2.9K]

Answer:

there teams management is good

4 0
3 years ago
Other questions:
  • Water flows at low speed through a circular tube with inside diameter of 2 in. A smoothly contoured body of 1.5 in. diameter is
    10·1 answer
  • A Si sample contains 1016 cm-3 In acceptor atoms and a certain number of shallow donors, the In acceptor level is 0.16 eV above
    5·2 answers
  • What is the temperature dependency of the electrical conductivity for metals and semiconductors??
    6·1 answer
  • What are the four basic parts of process plan
    11·1 answer
  • Water drains at a constant rate through a saturated soil column with a diameter of 1.5 feet and a height of 3 feet. The hydrauli
    11·1 answer
  • The combustion chamber has different shapes depending on the make and model of the engine. True or false
    8·1 answer
  • What must engineers keep in mind so that their solutions will be appropriate?
    15·1 answer
  • Describe the greatest power in design according to Aravena?
    15·1 answer
  • 3.8 LAB - Select lesson schedule with multiple joins
    11·1 answer
  • What is chemical engieering ?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!