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
We have a tube with a diameter of 5 inches that is 1 foot long. The tube then reduces the diameter to 3 inches. According to the
Ksju [112]
Can I get a picture? Of the question so I can understand it more?
6 0
3 years ago
Read 2 more answers
Water (density p-1000 is discharging from through a hole at the bottom of a graduated 71 cylinder. The mass flow rate exiting th
alexira [117]

Answer:

Please see attachment

Explanation:

Please see attachment

4 0
3 years ago
Is Tesla French, American, German, or Russian?
ozzi

Answer:

I am gonna say it is AMERICAN

6 0
3 years ago
Read 2 more answers
It is appropriate to use the following yield or failure criterion for ductile materials (a) Maximum shear stress or Tresca crite
Nataly [62]

Answer:

(b)Distortion energy theory.

Explanation:

The best suitable theory for ductile material:

       (1)Maximum shear stress theory (Guest and Tresca theory)

It theory state that applied maximum shear stress should be less or equal to its maximum shear strength.

      (2)Maximum distortion energy theory(Von Mises henkey's        theory)

It states that maximum shear train energy per unit volume at any point  is equal to strain energy per unit volume under the state of uni axial stress condition.

But from these two Best theories ,suitable theory is distortion energy theory ,because it gives best suitable result for ductile material.

6 0
3 years ago
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
3 years ago
Other questions:
  • To make 1000 containers of ice cream you need: 600 gallons of milk, 275 gallons of cream, and 120 gallons of flavor. Each ingred
    12·1 answer
  • Our goal is to design a traffic-light controller with the following properties; it lights up the green light (output G) for 15 s
    7·1 answer
  • List irreversibilities
    11·1 answer
  • Calculate the molar heat capacity of a monatomic non-metallic solid at 500K which is characterized by an Einstein temperature of
    8·1 answer
  • A landowner and a contractor entered into a written contract under which the contractor agreed to build a building and pave an a
    14·1 answer
  • Can someone explain the answer for this question please? -metrology
    12·1 answer
  • Pleaseeee help me with this!!
    10·1 answer
  • While discussing the diagnosis of an EI system in which the crankshaft and camshaft sensor tests are satisfactory but a spark te
    13·1 answer
  • The volume of microbial culture is observed to increase according to the formula
    15·1 answer
  • In the case of a collision causing property damage, injury, or death, you are required to ____
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!