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
Nitrogen gas is compressed at steady state from a pressure of 14.2 psi and a temperature 60o F to a pressure of 120 psi and a te
brilliants [131]

Answer:

a) 229.4281 hp.

b) 262.15 ft3/min.

Explanation:

Given data:

P1 = 14.2 psi

T1 = 60°F = 520° R

P2 = 120 psi

T2 = 500°F = 960° R

volumetric flow rate ( Av1 ) = 1200 ft^3 /min = 20 ft^3 / sec

attached below is the detailed solution

5 0
2 years ago
What are the mechanical properties of a geotextile that are of most importance when using it as a separator in an unpaved road s
Alekssandra [29.7K]

hey thanks for the point's i really needed them.. Cheers!

adhrtftgHDSRFDdhrgdrgfsdhrgfa

6 0
3 years ago
Engine vacuum is being discussed. Technician A says that when the engine is operating under light loads, engine vacuum is low. T
sdas [7]

Neither of the two technicians (Technician A and Technician B) is correct.

<h3>What is an engine vacuum?</h3>

An engine vacuum can be defined as a type of engine which is designed and developed to derive its force from air pressure that's being pushed against one side of the piston of an automobile, while having a partial vacuum on the other side.

In this scenario, we can infer and logically conclude that neither of the two technicians (Technician A and Technician B) is correct because engine vacuum is high when the engine is operating under light loads and vice-versa.

Read more on engine vacuum here: brainly.com/question/14602340

#SPJ12

6 0
2 years ago
What is the volume of the rectangular prism shown.
Likurg_2 [28]
It would be 72cm bc u need to add up all the line in the back to
7 0
3 years ago
Two common methods of improving fuel efficiency of a vehicle are to reduce the drag coefficient and the frontal area of the vehi
qaws [65]

Answer:

\Delta V = 209.151\,L, \Delta C = 217.517\,USD

Explanation:

The drag force is equal to:

F_{D} = C_{D}\cdot \frac{1}{2}\cdot \rho_{air}\cdot v^{2}\cdot A

Where C_{D} is the drag coefficient and A is the frontal area, respectively. The work loss due to drag forces is:

W = F_{D}\cdot \Delta s

The reduction on amount of fuel is associated with the reduction in work loss:

\Delta W = (F_{D,1} - F_{D,2})\cdot \Delta s

Where F_{D,1} and F_{D,2} are the original and the reduced frontal areas, respectively.

\Delta W = C_{D}\cdot \frac{1}{2}\cdot \rho_{air}\cdot v^{2}\cdot (A_{1}-A_{2})\cdot \Delta s

The change is work loss in a year is:

\Delta W = (0.3)\cdot \left(\frac{1}{2}\right)\cdot (1.20\,\frac{kg}{m^{3}})\cdot (27.778\,\frac{m}{s})^{2}\cdot [(1.85\,m)\cdot (1.75\,m) - (1.50\,m)\cdot (1.75\,m)]\cdot (25\times 10^{6}\,m)

\Delta W = 2.043\times 10^{9}\,J

\Delta W = 2.043\times 10^{6}\,kJ

The change in chemical energy from gasoline is:

\Delta E = \frac{\Delta W}{\eta}

\Delta E = \frac{2.043\times 10^{6}\,kJ}{0.3}

\Delta E = 6.81\times 10^{6}\,kJ

The changes in gasoline consumption is:

\Delta m = \frac{\Delta E}{L_{c}}

\Delta m = \frac{6.81\times 10^{6}\,kJ}{44000\,\frac{kJ}{kg} }

\Delta m = 154.772\,kg

\Delta V = \frac{154.772\,kg}{0.74\,\frac{kg}{L} }

\Delta V = 209.151\,L

Lastly, the money saved is:

\Delta C = \left(\frac{154.772\,kg}{0.74\,\frac{kg}{L} }\right)\cdot (1.04\,\frac{USD}{L} )

\Delta C = 217.517\,USD

4 0
3 years ago
Other questions:
  • A 3-kg block rests on top of a 2-kg block supported by, but not attached to, a spring of constant 40 N/m. The upper block is sud
    14·2 answers
  • What are four engineering degrees that can help lead you to becoming an aerospace engineer
    6·1 answer
  • 2 Consider airflow over a plate surface maintained at a temperature of 220°C. The temperature profile of the airflow is given as
    13·1 answer
  • The manufacturer of a 1.5 V D flashlight battery says that the battery will deliver 9 mA for 40 continuous hours. During that ti
    11·1 answer
  • Write a program in C++ that can be used by a small theater to sell tickets for performances.The theater’s auditorium has 15 rows
    7·1 answer
  • 1. What's the maximum overall length of the part?<br> 2. What material is used to fabricate the part
    5·1 answer
  • A steam power plant with a power output of 230 MW consumes coal at a rate of 60 tons/h. If the heating value of the coal is 30,0
    5·1 answer
  • Somebody help me!! It’s due today
    9·1 answer
  • Which of the following characteristics would not give animals an advantage in the ocean?
    13·1 answer
  • Water flow enters a pipe at a velocity of 1m/s. The pipe inlet is 10cm. The pipe outlet is 6cm. 1. Determine the velocity of the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!