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]
2 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]2 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
Estimate the theoretical fracture strength (in MPa) of a brittle material if it is known that fracture occurs by the propagation
Annette [7]

Answer:

σ =20700 MPa

Explanation:

Answer is in the following attachment

6 0
3 years ago
Tranquilizing drugs that inhibit sympathetic nervous system activity often effectively reduce people's subjective experience of
bagirrra123 [75]

Answer: There are different types of emotion theories. The one we will use here to explain is the two-factor theory otherwise known as Schachter-Singer theory. It's the best way to look at what is going on with how tranquilliser affect emotion.

Explanation: There are two ways emotion is formed. First one is the physiological reaction such as heart beat, and there is also the cognitive reactions which is usually subjective based in what someone is experiencing like fear, anger, excitement etc, so the nervous system gives off physiological(active) reaction that causes a subjective (cognitive) feelings such as fear and anxiety. The tranquilliser inhibit the physiological reaction in one factor of the cognitive reactions which shows the actual emotion.

However, the cannon-Bard theory suggest arousal and emotions occurred the same time, which makes it difficult in explaining emotion-reducing effect.

Hope this helps.

6 0
3 years ago
Two variables, num_boys and num_girls, hold the number of boys and girls that have registered for an elementary school. The vari
Flauer [41]

Answer:

Using python

num_boys = int(input("Enter number of boys :"))

num_girls = int(input("Enter number of girls :"))

budget = int(input("Enter the number of dollars spent per school year :"))

try:

dollarperstudent = budget/(num_boys+num_girls)

print("Dollar spent per student : "+str(dollarperstudent))#final result

except ZeroDivisionError:

print("unavailable")

3 0
3 years ago
On the position time curve, if the slope of a tangent at a point is positive, that means:
Gnoma [55]

Answer:

  C. the object is moving forward

Explanation:

A positive slope means position is increasing when time is increasing. Generally, increasing position is "moving forward."

7 0
3 years ago
Read 2 more answers
1. A thin-walled cylindrical pressure vessel is capped at the end and is subjected to an internal pressure (p). The inside diame
Vesna [10]
I DONT KNOW OKAY UGHHH
6 0
3 years ago
Other questions:
  • For each section illustrated, find the second moment of area, the location of the neutral axis, and the distances from the neutr
    13·1 answer
  • Effect of feedback on the plant is to a) Control system transient response b) Reduce the sensitivity to plant parameter variatio
    15·1 answer
  • Consider a unidirectional continuous fiber-reinforced composite with epoxy as the matrix with 55% by volume fiber.i. Calculate t
    10·1 answer
  • A heavy ball with a weight of 110 N is hung from the ceiling of a lecture hall on a 4.9-m-long rope. The ball is pulled to one s
    6·1 answer
  • An air conditioner using refrigerant-134a as the working fluid and operating on the ideal vapor-compression refrigeration cycle
    7·2 answers
  • A completely mixed activated-sludge process is being designed for a wastewater flow of 10,000 m3/d (2.64 mgd) using the kinetics
    6·1 answer
  • How to identify this fossil
    9·1 answer
  • The minimum fresh air requirement of a residential building is specified to be 0.35 air changes per hour (ASHRAE, Standard 62, 1
    10·1 answer
  • PLZZZZZ HELP
    7·2 answers
  • I am sending an email to my teacher. Is this mature enough?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!