Write an Arduino code to control two LEDs using two push buttons, given the bellow setup: LED 1 is connected to pin 2 LED 2 is connected to pin 12 Button 1 is connected to pin 11 Button 2 is connected to pin 10 If both push buttons are pressed, LED 1 is OFF and LED 2 is ON. If one of the push buttons is pressed LED 2 is OFF and LED 1 is ON. hint: you may use the if..else if statement (note: you may use other approaches)

Electric Motor Control
10th Edition
ISBN:9781133702818
Author:Herman
Publisher:Herman
Chapter32: Two-speed, One-winding (consequent Pole) Motor Controllers
Section: Chapter Questions
Problem 6SQ: Describe the operation of Figure 325 (B) by adding jumper wire A to the original circuit.
icon
Related questions
Question

DO NOT WRITE THE CODE IN HANDWRITTEN

 

Write an Arduino code to control two LEDs using two push buttons, given the bellow setup:

  • LED 1 is connected to pin 2
  • LED 2 is connected to pin 12
  • Button 1 is connected to pin 11
  • Button 2 is connected to pin 10

If both push buttons are pressed, LED 1 is OFF and LED 2 is ON. If one of the push buttons is pressed LED 2 is OFF and LED 1 is ON.

hint: you may use the if..else if statement (note: you may use other approaches)

 

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
8051 Microcontroller
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Electric Motor Control
Electric Motor Control
Electrical Engineering
ISBN:
9781133702818
Author:
Herman
Publisher:
CENGAGE L
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning