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 type of engineers were the designers of the Great Pyramids of Egypt and the Great Wall of China?
Gemiola [76]
I think it’s structural engineers but still check with the others
8 0
3 years ago
Read 2 more answers
What type of car engine is best for cold weather.
Komok [63]

Answer:Antifreeze/coolant

Explanation: keeps your engine cool in warm weather and keeps it from freezing up in the winter. A 50-50 mix of full strength coolant and water generally protects to around -30 degrees Fahrenheit. Make sure you check with the supplier or your owner's manual for the correct formulation

5 0
2 years ago
If it is desired to lay off a distance of 10,000' with a total error of no more than ± 0.30 ft. If a 100' tape is used and the
Ira Lisetskai [31]

Answer:

± 0.003 ft

Explanation:

Since our distance is 10,000 ft and we need to use a full tape measure of 100 ft. We find that 10,000 = 100 × 100.

Let L' = our distance and L = our tape measure

So, L' = 100L

Now by error determination ΔL' = 100ΔL

Now ΔL' = ± 0.30 ft

ΔL = ΔL'/100

= ± 0.30 ft/100

= ± 0.003 ft

So, the maxim error per tape is ± 0.003 ft

3 0
3 years ago
If you are driving a 30-foot
Ratling [72]

Answer:

3 sec

If you are driving a 30-foot vehicle at 55 mph, how many seconds of following distance should you allow? 30ft truck. = 3 sec. Since the truck is over 40 mph.

Explanation:

5 0
3 years ago
Q9. A cylindrical specimen of a metal alloy 54.8 mm long and 10.8 mm in diameter is stressed in tension. A true stress of 365 MP
wolverine [178]

Answer:

σ = 391.2 MPa

Explanation:

The relation between true stress and true strain is given as:

σ = k εⁿ

where,

σ = true stress = 365 MPa

k = constant

ε = true strain = Change in Length/Original Length

ε = (61.8 - 54.8)/54.8 = 0.128

n = strain hardening exponent = 0.2

Therefore,

365 MPa = K (0.128)^0.2

K = 365 MPa/(0.128)^0.2

k = 550.62 MPa

Now, we have the following data:

σ = true stress = ?

k = constant = 550.62 MPa

ε = true strain = Change in Length/Original Length

ε = (64.7 - 54.8)/54.8 = 0.181

n = strain hardening exponent = 0.2

Therefore,

σ = (550.62 MPa)(0.181)^0.2

<u>σ = 391.2 MPa</u>

7 0
3 years ago
Other questions:
  • The structure supports a distributed load of w. The limiting stress in rod (1) is 370 MPa, and the limiting stress in each pin i
    5·1 answer
  • An air compressor of mass 120 kg is mounted on an elastic foundation. It has been observed that, when a harmonic force of amplit
    13·1 answer
  • Give an example of how the fields of science, technology, and mathematics are commonly used when building a highway.
    7·1 answer
  • Air enters a 200 mm diameter adiabatic nozzle at 195 deg C, 500 kPa and 100 m/s. It exits at 85 kPa. If the exit diameter is 158
    11·1 answer
  • For the system in problem 4, suppose a main memory access requires 30ns, the page fault rate is .01%, it costs 12ms to access a
    14·1 answer
  • You’re going to write a program that models the Littleton City Lotto (not a real Lotto game). The program is going to allow to u
    6·1 answer
  • Which of the following describes a product concept?
    15·1 answer
  • How the LED (light emitting diode) works?​
    8·2 answers
  • What financial arguments could you use to justify your proposed
    14·1 answer
  • EverFi future smart pie chart
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!