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
If the density of states function in the conduction band of a particular semiconductor is a constant equal to K, derive the expr
s2008m [1.1K]

Answer:

full details of the answer is attached

5 0
3 years ago
The mechanical energy of an object is a combination of its potential energy and its
saveliy_v [14]

The mechanical energy of an object is a combination of its potential energy and its <em><u>kinetic</u></em><em><u> </u></em><em><u>energy</u></em><em><u>.</u></em>

6 0
2 years ago
Were is carbon monoxide located in a car
Semenov [28]

Answer:

all exhaust gases from all gasoline engines

Explanation:

if u look at the back of ur car when its on u can feel the heat from the exhaust and whT ur feeling is the heat coming from the carbon monoxide gases

6 0
3 years ago
Read 2 more answers
Two units for measuring magnetic flux density are:
romanna [79]
The correct answer is A
Faraday and Weber
:)
5 0
2 years ago
In a 5V system if you were asked to take one input HIGH and another LOW what would you do (i.e. where would you connect them)?
dangina [55]

Answer:

HIGH from the supply voltage

LOW from ground

Explanation:

The answer depends on the kind of system and the purpose of the signal. But for practical reasons, in a DIGITAL system where 5V is HIGH and 0 V is LOW, 5 volts can be taken from the supply voltage (usually the same as high,  BUT must be verified), and the LOW signal from ground.

If the user has a multimeter, it must be set to continuous voltage on 0 to 20 V range.  Then place the probe in the ground of the circuit (must be a big copper area). Finally  leave one probe in the circuit ground and place the other probe in some test points to identify 5 v.

4 0
3 years ago
Other questions:
  • A ring-shaped seal, made from a viscoelastic material, is used to seal a joint between two rigid pipes. When incorporated in the
    5·1 answer
  • In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab
    14·1 answer
  • Compared to arc welding, which of the following statements are true about<br> gas welding?
    13·1 answer
  • Verify the below velocity distribution describes a fluid in a state of pure rotation. What is the angular Velocity? (a)-Vx = -1/
    7·1 answer
  • You are considering purchasing a compact washing machine, and you have the following information: The Energy Guide claims an est
    8·1 answer
  • With a brief description, What are the 14 principles of management by fayol.​
    10·1 answer
  • B) Calculate the FS against uplift and calculate effoctive stress at the base level for water
    11·1 answer
  • First real answer i’ll give Brainlyist
    12·1 answer
  • When nondeterminism results from multiple threads attempting to access a shared resource such as a shared variable or a shared f
    9·1 answer
  • Bore = 3"
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!